-
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 array clobering by user error handler
Fixes oss-fuzz #42234
- Loading branch information
Showing
6 changed files
with
317 additions
and
478 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,25 @@ | ||
--TEST-- | ||
Array object clobbering by user error handler | ||
--FILE-- | ||
<?php | ||
class A implements ArrayAccess { | ||
public function &offsetGet($n) { | ||
} | ||
public function offsetSet($n, $v) { | ||
} | ||
public function offsetUnset($n) { | ||
} | ||
public function offsetExists($n) { | ||
} | ||
} | ||
|
||
set_error_handler(function () { | ||
$GLOBALS['a'] = null; | ||
}); | ||
|
||
$a = new A; | ||
$a[$c]; | ||
?> | ||
DONE | ||
--EXPECT-- | ||
DONE |
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
Oops, something went wrong.