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

index 5781da4e0e603f1ee605c4a9219a06e804e76fa6..1096b1f8e67e51bdb04dccdb9b4d60e2c4c24110 100644 (file)
@@ -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) {