File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -504,6 +504,8 @@ static int mersennetwister_serialize(void *state, HashTable *data) {
504504 }
505505 ZVAL_LONG (& tmp , s -> cnt );
506506 zend_hash_next_index_insert (data , & tmp );
507+ ZVAL_LONG (& tmp , s -> mode );
508+ zend_hash_next_index_insert (data , & tmp );
507509 ZVAL_LONG (& tmp , s -> seeded );
508510 zend_hash_next_index_insert (data , & tmp );
509511
@@ -523,12 +525,17 @@ static int mersennetwister_unserialize(void *state, HashTable *data) {
523525
524526 s -> s [i ] = Z_LVAL_P (tmp );
525527 }
526- tmp = zend_hash_index_find (data , MT_N ); /* cnt */
528+ tmp = zend_hash_index_find (data , MT_N );
527529 if (!tmp || Z_TYPE_P (tmp ) != IS_LONG ) {
528530 return FAILURE ;
529531 }
530532 s -> cnt = Z_LVAL_P (tmp );
531- tmp = zend_hash_index_find (data , MT_N + 1 ); /* seeded */
533+ tmp = zend_hash_index_find (data , MT_N + 1 );
534+ if (!tmp || Z_TYPE_P (tmp ) != IS_LONG ) {
535+ return FAILURE ;
536+ }
537+ s -> mode = Z_LVAL_P (tmp );
538+ tmp = zend_hash_index_find (data , MT_N + 2 );
532539 if (!tmp || Z_TYPE_P (tmp ) != IS_LONG ) {
533540 return FAILURE ;
534541 }
You can’t perform that action at this time.
0 commit comments