From 34feaa2720d9ec6bf9568a1aa22e71f725d7b9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?= <grubba@grubba.org> Date: Sun, 12 Oct 2008 17:26:44 +0200 Subject: [PATCH] Fixed potential buffer overrun in low_getstring() when called with zero length. Rev: src/modules/_PGsql/PGsql.cmod:1.30 --- src/modules/_PGsql/PGsql.cmod | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/_PGsql/PGsql.cmod b/src/modules/_PGsql/PGsql.cmod index 3f72a02522..0cbdbfa8aa 100644 --- a/src/modules/_PGsql/PGsql.cmod +++ b/src/modules/_PGsql/PGsql.cmod @@ -1,5 +1,5 @@ /* -*- c -*- - * $Id: PGsql.cmod,v 1.29 2008/08/25 23:39:16 srb Exp $ + * $Id: PGsql.cmod,v 1.30 2008/10/12 15:26:44 grubba Exp $ * * PGsql, accelerator functions for Sql.pgsql for Pike. * @@ -166,10 +166,10 @@ ret2: PD((stderr,"PGsql getbyte 0x%02x=%c\n",retval,retval)); static struct pike_string*low_getstring(int length) { struct pike_string*retval; struct string_builder sb,*psb=0; - int len,left; + int len = 0,left; uchar*p; #ifdef PIKE_DEBUG /* placate silly warnings */ - len=0;retval=0;p=0; /* these initialisations are useless */ + retval=0;p=0; /* these initialisations are useless */ #endif if(length) { len=length; -- GitLab