-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GH-16414: zend_test.observer.observe_function_names may segfault
Unless `zend_test.observer.enabled` is on, we must not add observer handlers, so we let the INI modify handler fail early. We also need to ensure that the functions to observe have already been called, so that their begin and end handlers are properly initialized. Otherwise we will not observe the function execution, but a segfault. Co-authored-by: Bob Weinand <[email protected]> Closes GH-16438.
- Loading branch information
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--TEST-- | ||
GH-16414 (zend_test.observer.observe_function_names may segfault) | ||
--EXTENSIONS-- | ||
zend_test | ||
--INI-- | ||
zend_test.observer.enabled=0 | ||
--FILE-- | ||
<?php | ||
function bar() {} | ||
var_dump(ini_set("zend_test.observer.observe_function_names", "bar")); | ||
?> | ||
--EXPECT-- | ||
bool(false) |