-
Notifications
You must be signed in to change notification settings - Fork 7.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix GH-17797: zend_test_compile_string crash on invalid script path.
When looking for the last slash of the script path, it leads to underflow being promoted to SIZE_MAX being way beyond MAXPATHLEN.
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
--TEST-- | ||
GH-17797 (zend_test_compile_string crash on invalid script path) | ||
--EXTENSIONS-- | ||
zend_test | ||
--CREDITS-- | ||
YuanchengJiang | ||
--FILE-- | ||
<?php | ||
$source = '<?php | ||
require("sumfile.php"); | ||
?>'; | ||
try {zend_test_compile_string($source,$source,$c);} catch (Exception $e) { echo($e); } | ||
--EXPECTF-- | ||
|
||
Warning: Undefined variable $c in %s on line %d | ||
|
||
Deprecated: zend_test_compile_string(): Passing null to parameter #3 ($position) of type int is deprecated in %s on line %d | ||
|
||
Warning: require(sumfile.php): Failed to open stream: No such file or directory in <?php | ||
require("sumfile.php"); | ||
?> on line %d | ||
|
||
Fatal error: Uncaught Error: Failed opening required 'sumfile.php' (include_path='.:') in <?php | ||
require("sumfile.php"); | ||
?>:%d | ||
Stack trace: | ||
#0 %s(%d): zend_test_compile_string('<?php\nrequire("...', '<?php\nrequire("...', NULL) | ||
#1 {main} | ||
thrown in <?php | ||
require("sumfile.php"); | ||
?> on line %d |
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