File tree 1 file changed +9
-2
lines changed
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) {
504
504
}
505
505
ZVAL_LONG (& tmp , s -> cnt );
506
506
zend_hash_next_index_insert (data , & tmp );
507
+ ZVAL_LONG (& tmp , s -> mode );
508
+ zend_hash_next_index_insert (data , & tmp );
507
509
ZVAL_LONG (& tmp , s -> seeded );
508
510
zend_hash_next_index_insert (data , & tmp );
509
511
@@ -523,12 +525,17 @@ static int mersennetwister_unserialize(void *state, HashTable *data) {
523
525
524
526
s -> s [i ] = Z_LVAL_P (tmp );
525
527
}
526
- tmp = zend_hash_index_find (data , MT_N ); /* cnt */
528
+ tmp = zend_hash_index_find (data , MT_N );
527
529
if (!tmp || Z_TYPE_P (tmp ) != IS_LONG ) {
528
530
return FAILURE ;
529
531
}
530
532
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 );
532
539
if (!tmp || Z_TYPE_P (tmp ) != IS_LONG ) {
533
540
return FAILURE ;
534
541
}
You can’t perform that action at this time.
0 commit comments