Skip to content

Commit

Permalink
Finish reverting gmp_pow overflow check
Browse files Browse the repository at this point in the history
  • Loading branch information
devnexen authored and Girgias committed Nov 27, 2024
1 parent 0833f23 commit 424ba0f
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions ext/gmp/gmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,14 +1140,7 @@ ZEND_FUNCTION(gmp_pow)
RETURN_THROWS();
}

double powmax = log((double)ZEND_LONG_MAX);

INIT_GMP_RETVAL(gmpnum_result);
zend_ulong gmpnum = mpz_get_ui(gmpnum_base);
if ((log(gmpnum) * exp) > powmax) {
zend_value_error("base and exponent overflow");
RETURN_THROWS();
}
mpz_pow_ui(gmpnum_result, gmpnum_base, exp);
}
/* }}} */
Expand Down

0 comments on commit 424ba0f

Please sign in to comment.