Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kocsismate committed Aug 26, 2022
1 parent e0d18d0 commit b06b007
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions ext/random/engine_mt19937.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ PHP_METHOD(Random_Engine_Mt19937, __unserialize)
}
object_properties_load(&engine->std, Z_ARRVAL_P(t));
if (EG(exception)) {
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(engine->std.ce->name));
RETURN_THROWS();
}

Expand Down
4 changes: 2 additions & 2 deletions ext/random/tests/03_randomizer/gh_9186_unserialize.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ Fix GH-9186 @strict-properties can be bypassed using unserialization

try {
unserialize('O:17:"Random\Randomizer":1:{i:0;a:2:{s:3:"foo";N;s:6:"engine";O:32:"Random\Engine\Xoshiro256StarStar":2:{i:0;a:0:{}i:1;a:4:{i:0;s:16:"7520fbc2d6f8de46";i:1;s:16:"84d2d2b9d7ba0a34";i:2;s:16:"d975f36db6490b32";i:3;s:16:"c19991ee16785b94";}}}}');
} catch (Error $error) {
} catch (Exception $error) {
echo $error->getMessage() . "\n";
}

?>
--EXPECT--
Cannot create dynamic property Random\Randomizer::$foo
Invalid serialization data for Random\Randomizer object
2 changes: 2 additions & 0 deletions ext/spl/tests/bug70155.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ $data = unserialize($exploit);
var_dump($data);
?>
--EXPECTF--
Deprecated: Creation of dynamic property ArrayObject::$0 is deprecated in %s on line %d

Fatal error: Uncaught InvalidArgumentException: Overloaded object of type DateInterval is not compatible with ArrayObject in %s
Stack trace:
%s
Expand Down
2 changes: 2 additions & 0 deletions ext/spl/tests/bug74669.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ object(SelfArray)#9 (1) {
string(3) "bar"
}
string(77) "O:9:"SelfArray":4:{i:0;i:16777216;i:1;N;i:2;a:1:{s:3:"foo";s:3:"bar";}i:3;N;}"

Deprecated: Creation of dynamic property SelfArray::$foo is deprecated in %s on line %d
object(SelfArray)#9 (1) {
["foo"]=>
string(3) "bar"
Expand Down

0 comments on commit b06b007

Please sign in to comment.