From: Ilia Alshanetsky Date: Mon, 9 Feb 2004 04:27:35 +0000 (+0000) Subject: Fixed bug #27172 (Possible floating point exception in gmp_powm()). X-Git-Tag: php-5.0.0b4RC1~82 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e5020fdad1b34a7e34f291c66ffb02ef0558883;p=php Fixed bug #27172 (Possible floating point exception in gmp_powm()). --- diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 5781da4e0e..1096b1f8e6 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -825,6 +825,11 @@ ZEND_FUNCTION(gmp_powm) WRONG_PARAM_COUNT; } + convert_to_long_ex(mod_arg); + if (!Z_LVAL_PP(mod_arg)) { + RETURN_FALSE; + } + FETCH_GMP_ZVAL(gmpnum_base, base_arg); if (Z_TYPE_PP(exp_arg) == IS_LONG && Z_LVAL_PP(exp_arg) >= 0) {