@@ -179,6 +179,7 @@ if (IS_GMP(zval)) { \
179179 gmp_create(return_value, &gmpnumber)
180180
181181static 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 );
182183static zend_result convert_to_gmp (mpz_t gmpnumber , zval * val , zend_long base , uint32_t arg_pos );
183184static void gmp_cmp (zval * return_value , zval * a_arg , zval * b_arg , bool is_operator );
184185
@@ -493,7 +494,7 @@ static int gmp_unserialize(zval *object, zend_class_entry *ce, const unsigned ch
493494 zv = var_tmp_var (& unserialize_data );
494495 if (!php_var_unserialize (zv , & p , max , & unserialize_data )
495496 || 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
497498 ) {
498499 zend_throw_exception (NULL , "Could not unserialize number" , 0 );
499500 goto exit ;
@@ -2108,7 +2109,7 @@ ZEND_METHOD(GMP, __unserialize)
21082109
21092110 zval * num = zend_hash_index_find (data , 0 );
21102111 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 ) {
21122113 zend_throw_exception (NULL , "Could not unserialize number" , 0 );
21132114 RETURN_THROWS ();
21142115 }
0 commit comments