mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
Fixed wrong buffer length (added place for terminating zero)
This commit is contained in:
parent
b2b508a279
commit
f089be8291
@ -2883,11 +2883,11 @@ static int zend_is_callable_check_func(int check_flags, zval *callable, zend_fca
|
|||||||
|
|
||||||
/* Skip leading \ */
|
/* Skip leading \ */
|
||||||
if (Z_STRVAL_P(callable)[0] == '\\') {
|
if (Z_STRVAL_P(callable)[0] == '\\') {
|
||||||
lmname = do_alloca(Z_STRLEN_P(callable) - 1, use_heap);
|
lmname = do_alloca(Z_STRLEN_P(callable), use_heap);
|
||||||
lmname_len = Z_STRLEN_P(callable) - 1;
|
lmname_len = Z_STRLEN_P(callable) - 1;
|
||||||
zend_str_tolower_copy(lmname, Z_STRVAL_P(callable) + 1, lmname_len);
|
zend_str_tolower_copy(lmname, Z_STRVAL_P(callable) + 1, lmname_len);
|
||||||
} else {
|
} else {
|
||||||
lmname = do_alloca(Z_STRLEN_P(callable), use_heap);
|
lmname = do_alloca(Z_STRLEN_P(callable) + 1, use_heap);
|
||||||
lmname_len = Z_STRLEN_P(callable);
|
lmname_len = Z_STRLEN_P(callable);
|
||||||
zend_str_tolower_copy(lmname, Z_STRVAL_P(callable), lmname_len);
|
zend_str_tolower_copy(lmname, Z_STRVAL_P(callable), lmname_len);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user