From c42fb0033dad7ecfa7513a90d46ac65f331d711c Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Thu, 28 Dec 2006 15:21:32 +0000 Subject: [PATCH] MFB: Added buffer length checks --- ext/pgsql/pgsql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 31ec83cebb..7c69108ce5 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -5472,7 +5472,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 */ -- 2.50.1