]> granicus.if.org Git - php/commitdiff
MFH: Added buffer length checks
authorIlia Alshanetsky <iliaa@php.net>
Thu, 28 Dec 2006 15:21:41 +0000 (15:21 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Thu, 28 Dec 2006 15:21:41 +0000 (15:21 +0000)
ext/pgsql/pgsql.c

index a831530b3d631974bff769a6fc562197b1d7cc42..cd2f7df1897ae529f7762b98b3f4b989bd6a8584 100644 (file)
@@ -4285,7 +4285,7 @@ static inline int build_assignment_string(smart_str *querystr, HashTable *ht, co
                                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 */