mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Handle debug_print_backtrace() from main script
If there is nothing to print, the smart_str will hold a nullptr. Fixes oss-fuzz #33334.
This commit is contained in:
parent
d05da0f06c
commit
8bb81226c1
7
Zend/tests/debug_print_backtrace_from_main.phpt
Normal file
7
Zend/tests/debug_print_backtrace_from_main.phpt
Normal file
@ -0,0 +1,7 @@
|
||||
--TEST--
|
||||
Calling debug_print_backtrace() from main script
|
||||
--FILE--
|
||||
<?php
|
||||
debug_print_backtrace();
|
||||
?>
|
||||
--EXPECT--
|
@ -1715,7 +1715,9 @@ ZEND_FUNCTION(debug_print_backtrace)
|
||||
zval_ptr_dtor(&backtrace);
|
||||
|
||||
smart_str_0(&str);
|
||||
ZEND_WRITE(ZSTR_VAL(str.s), ZSTR_LEN(str.s));
|
||||
if (str.s) {
|
||||
ZEND_WRITE(ZSTR_VAL(str.s), ZSTR_LEN(str.s));
|
||||
}
|
||||
smart_str_free(&str);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user