summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-02-09 04:27:35 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-02-09 04:27:35 +0000
commit0e5020fdad1b34a7e34f291c66ffb02ef0558883 (patch)
treead6ebb377f4d5d86d6ca358f1928f7d66a644e40 /ext
parentec09b090f91e039c3060c6888663b5e0f9d5ea73 (diff)
downloadphp-git-0e5020fdad1b34a7e34f291c66ffb02ef0558883.tar.gz
Fixed bug #27172 (Possible floating point exception in gmp_powm()).
Diffstat (limited to 'ext')
-rw-r--r--ext/gmp/gmp.c5
1 files changed, 5 insertions, 0 deletions
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) {