mirror of
https://github.com/php/php-src.git
synced 2024-11-27 11:53:33 +08:00
Add check for conversion base
This commit is contained in:
parent
848e51fda5
commit
4a3fdce696
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user