Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for oss-fuzz-61469: Undef dynamic property in ++/-- unset i…
- Loading branch information
Showing
5 changed files
with
86 additions
and
0 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
Zend/tests/in-de-crement/oss-fuzz-61469_binop_dynamic_property_unset_error_handler.phpt
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,16 @@ | ||
--TEST-- | ||
OSS Fuzz #61469: Undef variable in ++/-- for dynamic property that is unset in error handler | ||
--FILE-- | ||
<?php | ||
class C { | ||
function errorHandle() { | ||
unset($this->a); | ||
} | ||
} | ||
$c = new C; | ||
set_error_handler([$c,'errorHandle']); | ||
$c->a += 5; | ||
var_dump($c->a); | ||
?> | ||
--EXPECT-- | ||
int(5) |
19 changes: 19 additions & 0 deletions
19
Zend/tests/in-de-crement/oss-fuzz-61469_postdec_dynamic_property_unset_error_handler.phpt
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,19 @@ | ||
--TEST-- | ||
OSS Fuzz #61469: Undef variable in ++/-- for dynamic property that is unset in error handler | ||
--FILE-- | ||
<?php | ||
class C { | ||
function errorHandle() { | ||
unset($this->a); | ||
} | ||
} | ||
$c = new C; | ||
set_error_handler([$c,'errorHandle']); | ||
|
||
$v = ($c->a--); | ||
var_dump($c->a); | ||
var_dump($v); | ||
?> | ||
--EXPECT-- | ||
NULL | ||
NULL |
19 changes: 19 additions & 0 deletions
19
Zend/tests/in-de-crement/oss-fuzz-61469_postinc_dynamic_property_unset_error_handler.phpt
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,19 @@ | ||
--TEST-- | ||
OSS Fuzz #61469: Undef variable in ++/-- for dynamic property that is unset in error handler | ||
--FILE-- | ||
<?php | ||
class C { | ||
function errorHandle() { | ||
unset($this->a); | ||
} | ||
} | ||
$c = new C; | ||
set_error_handler([$c,'errorHandle']); | ||
|
||
$v = ($c->a--); | ||
var_dump($c->a); | ||
var_dump($v); | ||
?> | ||
--EXPECT-- | ||
NULL | ||
NULL |
16 changes: 16 additions & 0 deletions
16
Zend/tests/in-de-crement/oss-fuzz-61469_predec_dynamic_property_unset_error_handler.phpt
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,16 @@ | ||
--TEST-- | ||
OSS Fuzz #61469: Undef variable in ++/-- for dynamic property that is unset in error handler | ||
--FILE-- | ||
<?php | ||
class C { | ||
function errorHandle() { | ||
unset($this->a); | ||
} | ||
} | ||
$c = new C; | ||
set_error_handler([$c,'errorHandle']); | ||
(--$c->a); | ||
var_dump($c->a); | ||
?> | ||
--EXPECT-- | ||
NULL |
16 changes: 16 additions & 0 deletions
16
Zend/tests/in-de-crement/oss-fuzz-61469_preinc_dynamic_property_unset_error_handler.phpt
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,16 @@ | ||
--TEST-- | ||
OSS Fuzz #61469: Undef variable in ++/-- for dynamic property that is unset in error handler | ||
--FILE-- | ||
<?php | ||
class C { | ||
function errorHandle() { | ||
unset($this->a); | ||
} | ||
} | ||
$c = new C; | ||
set_error_handler([$c,'errorHandle']); | ||
(++$c->a); | ||
var_dump($c->a); | ||
?> | ||
--EXPECT-- | ||
int(1) |