From: Pierrick Charron Date: Mon, 8 Aug 2011 11:19:49 +0000 (+0000) Subject: Use snprintf to make the static analyzers happy X-Git-Tag: php-5.4.0beta1~477 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d0a4c010995b8a7231356e6072aa6cb96a8378e9;p=php Use snprintf to make the static analyzers happy --- diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index ce972a3ba8..d507b6f5fe 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1821,7 +1821,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);