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 */
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php