mirror of
https://github.com/php/php-src.git
synced 2024-09-22 10:27:25 +00:00
MFZE1 saschas 'Avoid exceeding buffer limits' patch
This commit is contained in:
parent
77629de74e
commit
8bf59c8fd0
@ -456,9 +456,10 @@ static int zend_parse_arg(int arg_num, zval **arg, va_list *va, char **spec, int
|
||||
expected_type = zend_parse_arg_impl(arg, va, spec);
|
||||
if (expected_type) {
|
||||
if (!quiet) {
|
||||
sprintf(buf, "%s() expects parameter %d to be %s, %s given",
|
||||
snprintf(buf, sizeof(buf)-1, "%s() expects parameter %d to be %s, %s given",
|
||||
get_active_function_name(TSRMLS_C), arg_num, expected_type,
|
||||
zend_zval_type_name(*arg));
|
||||
buf[sizeof(buf)-1] = '\0';
|
||||
zend_error(E_WARNING, buf);
|
||||
}
|
||||
return FAILURE;
|
||||
|
Loading…
Reference in New Issue
Block a user