cvs: php-src(PHP_5_2) /ext/pgsql pgsql.c

From: Date: Thu, 28 Dec 2006 15:21:21 +0000
Subject: cvs: php-src(PHP_5_2) /ext/pgsql pgsql.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-42454@lists.php.net to get a copy of this message
iliaa Thu Dec 28 15:21:21 2006 UTC Modified files: (Branch: PHP_5_2) /php-src/ext/pgsql pgsql.c Log: Added buffer length checks http://cvs.php.net/viewvc.cgi/php-src/ext/pgsql/pgsql.c?r1=1.331.2.13.2.12&r2=1.331.2.13.2.13&diff_format=u Index: php-src/ext/pgsql/pgsql.c diff -u php-src/ext/pgsql/pgsql.c:1.331.2.13.2.12 php-src/ext/pgsql/pgsql.c:1.331.2.13.2.13 --- php-src/ext/pgsql/pgsql.c:1.331.2.13.2.12 Mon Dec 25 22:36:57 2006 +++ php-src/ext/pgsql/pgsql.c Thu Dec 28 15:21:21 2006 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: pgsql.c,v 1.331.2.13.2.12 2006/12/25 22:36:57 iliaa Exp $ */ +/* $Id: pgsql.c,v 1.331.2.13.2.13 2006/12/28 15:21:21 iliaa Exp $ */ #include <stdlib.h> @@ -5485,7 +5485,7 @@ smart_str_append_long(querystr, Z_LVAL_PP(val)); break; case IS_DOUBLE: - smart_str_appendl(querystr, buf, sprintf(buf, "%f", Z_DVAL_PP(val))); + smart_str_appendl(querystr, buf, MIN(snprintf(buf, sizeof(buf), "%f", Z_DVAL_PP(val)), sizeof(buf)-1)); break; default: /* should not happen */

« previous php.cvs (#42454) next »