Skip to content

Fix oss-fuzz-61469: Undef dynamic property in ++/-- unset in error handler #12011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
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
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
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
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)