]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #27172 (Possible floating point exception in gmp_powm()).
authorIlia Alshanetsky <iliaa@php.net>
Mon, 9 Feb 2004 04:28:07 +0000 (04:28 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 9 Feb 2004 04:28:07 +0000 (04:28 +0000)
NEWS
ext/gmp/gmp.c

diff --git a/NEWS b/NEWS
index 4a4a75d4bc61999be8df0047a54a0a4ddba7481d..0cf45290f0230c5fd3d77bd838a6f28ff00568f1 100644 (file)
--- 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)
index 87b28539f932d60959a275d073795e542989c71c..b8b67709184bfd894c2ff485e362345afb237a7c 100644 (file)
@@ -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;