Skip to content

Commit b06b007

Browse files
committed
Fix tests
1 parent e0d18d0 commit b06b007

File tree

4 files changed

+7
-2
lines changed

4 files changed

+7
-2
lines changed

ext/random/engine_mt19937.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,7 @@ PHP_METHOD(Random_Engine_Mt19937, __unserialize)
366366
}
367367
object_properties_load(&engine->std, Z_ARRVAL_P(t));
368368
if (EG(exception)) {
369+
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(engine->std.ce->name));
369370
RETURN_THROWS();
370371
}
371372

ext/random/tests/03_randomizer/gh_9186_unserialize.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ Fix GH-9186 @strict-properties can be bypassed using unserialization
55

66
try {
77
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";}}}}');
8-
} catch (Error $error) {
8+
} catch (Exception $error) {
99
echo $error->getMessage() . "\n";
1010
}
1111

1212
?>
1313
--EXPECT--
14-
Cannot create dynamic property Random\Randomizer::$foo
14+
Invalid serialization data for Random\Randomizer object

ext/spl/tests/bug70155.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ $data = unserialize($exploit);
99
var_dump($data);
1010
?>
1111
--EXPECTF--
12+
Deprecated: Creation of dynamic property ArrayObject::$0 is deprecated in %s on line %d
13+
1214
Fatal error: Uncaught InvalidArgumentException: Overloaded object of type DateInterval is not compatible with ArrayObject in %s
1315
Stack trace:
1416
%s

ext/spl/tests/bug74669.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ object(SelfArray)#9 (1) {
105105
string(3) "bar"
106106
}
107107
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;}"
108+
109+
Deprecated: Creation of dynamic property SelfArray::$foo is deprecated in %s on line %d
108110
object(SelfArray)#9 (1) {
109111
["foo"]=>
110112
string(3) "bar"

0 commit comments

Comments
 (0)