Skip to content
Snippets Groups Projects
Commit 3679ee9b authored by Pavol Rusnak's avatar Pavol Rusnak Committed by Paul Sokolovsky
Browse files

py: fix null pointer dereference in mpz.c, fix missing va_end in warning.c

parent e377f3cb
No related branches found
No related tags found
No related merge requests found
......@@ -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;
}
......
......@@ -38,6 +38,7 @@ void mp_warning(const char *msg, ...) {
mp_print_str(&mp_plat_print, "Warning: ");
mp_vprintf(&mp_plat_print, msg, args);
mp_print_str(&mp_plat_print, "\n");
va_end(args);
}
void mp_emitter_warning(pass_kind_t pass, const char *msg) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment