mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 20:20:14 +01:00
py: fix null pointer dereference in mpz.c, fix missing va_end in warning.c
This commit is contained in:
committed by
Paul Sokolovsky
parent
e377f3cb40
commit
3679ee9b52
5
py/mpz.c
5
py/mpz.c
@@ -1652,7 +1652,10 @@ char *mpz_as_str(const mpz_t *i, mp_uint_t base) {
|
||||
// assumes enough space as calculated by mp_int_format_size
|
||||
// returns length of string, not including null byte
|
||||
mp_uint_t mpz_as_str_inpl(const mpz_t *i, mp_uint_t base, const char *prefix, char base_char, char comma, char *str) {
|
||||
if (str == NULL || base < 2 || base > 32) {
|
||||
if (str == NULL) {
|
||||
return 0;
|
||||
}
|
||||
if (base < 2 || base > 32) {
|
||||
str[0] = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user