mirror of
https://github.com/php/php-src.git
synced 2026-04-14 19:41:05 +02:00
Add check for conversion base
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user