summaryrefslogtreecommitdiff
path: root/ext/gmp/gmp.c
diff options
context:
space:
mode:
authorStanislav Malyshev <stas@php.net>2000-12-05 14:17:38 +0000
committerStanislav Malyshev <stas@php.net>2000-12-05 14:17:38 +0000
commit4a3fdce6967b35bea4261bbdef87be049402cb86 (patch)
tree96aba49922a38b3b63268c7420c656469fe2c2e1 /ext/gmp/gmp.c
parent848e51fda588059b870ace887fb47bb758e9fda1 (diff)
downloadphp-git-4a3fdce6967b35bea4261bbdef87be049402cb86.tar.gz
Add check for conversion base
Diffstat (limited to 'ext/gmp/gmp.c')
-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 f286956154..372a369d98 100644
--- a/ext/gmp/gmp.c
+++ b/ext/gmp/gmp.c
@@ -440,6 +440,11 @@ ZEND_FUNCTION(gmp_strval)
break;
}
+ if(base < 2 || base > 36) {
+ zend_error(E_WARNING, "Bad base for conversion: %d", base);
+ RETURN_FALSE;
+ }
+
num_len = mpz_sizeinbase(*gmpnum, base);
out_string = emalloc(num_len+2);
if(mpz_sgn(*gmpnum) < 0) {