Skip to content
Draft
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
10 changes: 5 additions & 5 deletions ext/random/engine_mt19937.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,30 +348,30 @@ PHP_METHOD(Random_Engine_Mt19937, __unserialize)

/* Verify the expected number of elements, this implicitly ensures that no additional elements are present. */
if (zend_hash_num_elements(d) != 2) {
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(engine->std.ce->name));
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", engine->std.ce->name);
RETURN_THROWS();
}

/* members */
t = zend_hash_index_find(d, 0);
if (!t || Z_TYPE_P(t) != IS_ARRAY) {
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(engine->std.ce->name));
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", engine->std.ce->name);
RETURN_THROWS();
}
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));
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", engine->std.ce->name);
RETURN_THROWS();
}

/* state */
t = zend_hash_index_find(d, 1);
if (!t || Z_TYPE_P(t) != IS_ARRAY) {
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(engine->std.ce->name));
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", engine->std.ce->name);
RETURN_THROWS();
}
if (!engine->engine.algo->unserialize(engine->engine.state, Z_ARRVAL_P(t))) {
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %s object", ZSTR_VAL(engine->std.ce->name));
zend_throw_exception_ex(NULL, 0, "Invalid serialization data for %pS object", engine->std.ce->name);
RETURN_THROWS();
}
}
Expand Down
Loading