iliaa Thu Dec 28 15:21:41 2006 UTC
Modified files: (Branch: PHP_4_4)
/php-src/ext/pgsql pgsql.c
Log:
MFH: Added buffer length checks
http://cvs.php.net/viewvc.cgi/php-src/ext/pgsql/pgsql.c?r1=1.244.2.40.2.3&r2=1.244.2.40.2.4&diff_format=u
Index: php-src/ext/pgsql/pgsql.c
diff -u php-src/ext/pgsql/pgsql.c:1.244.2.40.2.3
php-src/ext/pgsql/pgsql.c:1.244.2.40.2.4
--- php-src/ext/pgsql/pgsql.c:1.244.2.40.2.3 Sun Jan 1 13:46:56 2006
+++ php-src/ext/pgsql/pgsql.c Thu Dec 28 15:21:41 2006
@@ -19,7 +19,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: pgsql.c,v 1.244.2.40.2.3 2006/01/01 13:46:56 sniper Exp $ */
+/* $Id: pgsql.c,v 1.244.2.40.2.4 2006/12/28 15:21:41 iliaa Exp $ */
#include <stdlib.h>
@@ -4285,7 +4285,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