-
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.
Prevent array modification if it's captured by user error handler during
index conversion Fixes oss-fuzz #44235
- Loading branch information
Showing
3 changed files
with
126 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
--TEST-- | ||
Capturing array in user error handler during index conversion | ||
--FILE-- | ||
<?php | ||
set_error_handler(function($code, $msg) { | ||
echo "Err: $msg\n"; | ||
$GLOBALS[''] = $GLOBALS['y']; | ||
}); | ||
function x(&$s){ | ||
$s[100000000000000000000] = 1; | ||
} | ||
x($y); | ||
var_dump($y); | ||
?> | ||
--EXPECT-- | ||
Err: Implicit conversion from float 1.0E+20 to int loses precision | ||
array(0) { | ||
} |
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