Use snprintf to make the static analyzers happy

This commit is contained in:
Pierrick Charron 2011-08-08 11:19:49 +00:00
parent 6c0c4896b3
commit cbd4f7602e

View File

@ -1713,7 +1713,7 @@ ZEND_FUNCTION(create_function)
function_name[0] = '\0';
do {
function_name_length = 1 + sprintf(function_name + 1, "lambda_%d", ++EG(lambda_count));
function_name_length = 1 + snprintf(function_name + 1, sizeof("0lambda_")+MAX_LENGTH_OF_LONG, "lambda_%d", ++EG(lambda_count));
} while (zend_hash_add(EG(function_table), function_name, function_name_length+1, &new_function, sizeof(zend_function), NULL)==FAILURE);
zend_hash_del(EG(function_table), LAMBDA_TEMP_FUNCNAME, sizeof(LAMBDA_TEMP_FUNCNAME));
RETURN_STRINGL(function_name, function_name_length, 0);