@@ -179,6 +179,7 @@ if (IS_GMP(zval)) { \
179
179
gmp_create(return_value, &gmpnumber)
180
180
181
181
static void gmp_strval (zval * result , mpz_t gmpnum , int base );
182
+ static zend_result convert_zstr_to_gmp (mpz_t gmp_number , const zend_string * val , zend_long base , uint32_t arg_pos );
182
183
static zend_result convert_to_gmp (mpz_t gmpnumber , zval * val , zend_long base , uint32_t arg_pos );
183
184
static void gmp_cmp (zval * return_value , zval * a_arg , zval * b_arg , bool is_operator );
184
185
@@ -493,7 +494,7 @@ static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned ch
493
494
zv = var_tmp_var (& unserialize_data );
494
495
if (!php_var_unserialize (zv , & p , max , & unserialize_data )
495
496
|| Z_TYPE_P (zv ) != IS_STRING
496
- || convert_to_gmp (gmpnum , zv , 10 , 0 ) == FAILURE
497
+ || convert_zstr_to_gmp (gmpnum , Z_STR_P ( zv ) , 10 , 0 ) == FAILURE
497
498
) {
498
499
zend_throw_exception (NULL , "Could not unserialize number" , 0 );
499
500
goto exit ;
@@ -2108,7 +2109,7 @@ ZEND_METHOD(GMP, __unserialize)
2108
2109
2109
2110
zval * num = zend_hash_index_find (data , 0 );
2110
2111
if (!num || Z_TYPE_P (num ) != IS_STRING ||
2111
- convert_to_gmp (GET_GMP_FROM_ZVAL (ZEND_THIS ), num , 16 , 0 ) == FAILURE ) {
2112
+ convert_zstr_to_gmp (GET_GMP_FROM_ZVAL (ZEND_THIS ), Z_STR_P ( num ) , 16 , /* arg_pos */ 0 ) == FAILURE ) {
2112
2113
zend_throw_exception (NULL , "Could not unserialize number" , 0 );
2113
2114
RETURN_THROWS ();
2114
2115
}
0 commit comments