From: Ilia Alshanetsky Date: Mon, 9 Feb 2004 04:28:07 +0000 (+0000) Subject: MFH: Fixed bug #27172 (Possible floating point exception in gmp_powm()). X-Git-Tag: php-4.3.5RC3~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6af73a9f5e6bdfc925d24ad972a0391b8a4e2e50;p=php MFH: Fixed bug #27172 (Possible floating point exception in gmp_powm()). --- diff --git a/NEWS b/NEWS index 4a4a75d4bc..0cf45290f0 100644 --- a/NEWS +++ b/NEWS @@ -3,6 +3,7 @@ PHP 4 NEWS ?? Feb 2004, Version 4.3.5 - Fixed bug #27175 (tzset() is not being called by PHP on startup). (Ilia, sagawa at sohgoh dot net) +- Fixed bug #27172 (Possible floating point exception in gmp_powm()). (Ilia) - Fixed bug #27171 (crash inside gmp_hamdist()). (Jani) - Fixed bug #27149 (broken CLOB support in oci8 extension). (Antony) - Fixed bug #27135 (Possible crash inside mb_strlen()). (Moriyoshi) diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index 87b28539f9..b8b6770918 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -814,6 +814,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) { use_ui=1;