MFB: Added buffer length checks

This commit is contained in:
Ilia Alshanetsky 2006-12-28 15:21:32 +00:00
parent 69c6843c9a
commit c42fb0033d

View file

@ -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)); smart_str_append_long(querystr, Z_LVAL_PP(val));
break; break;
case IS_DOUBLE: 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; break;
default: default:
/* should not happen */ /* should not happen */