diff options
author | Harald Radi <phanto@php.net> | 2002-04-24 15:46:40 +0000 |
---|---|---|
committer | Harald Radi <phanto@php.net> | 2002-04-24 15:46:40 +0000 |
commit | 8bf59c8fd0a0988680791ed793af84fd6a7a2a74 (patch) | |
tree | 91b4b9616afe686d98b2d2647e08804ee8f40efc | |
parent | 77629de74e3b8ac23a677b26fff91419bb53f638 (diff) | |
download | php-git-8bf59c8fd0a0988680791ed793af84fd6a7a2a74.tar.gz |
MFZE1 saschas 'Avoid exceeding buffer limits' patch
-rw-r--r-- | Zend/zend_API.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 67db62a218..015197ca68 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -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; |