diff --git a/asm/nasm.c b/asm/nasm.c index ca5584ea..927918c1 100644 --- a/asm/nasm.c +++ b/asm/nasm.c @@ -2017,8 +2017,7 @@ static void nasm_verror_common(int severity, const char *fmt, va_list args) * Don't suppress this with skip_this_pass(), or we don't get * pass1 or preprocessor warnings in the list file */ - if ((severity & ERR_MASK) >= ERR_WARNING) - lfmt->error(severity, pfx, msg); + lfmt->error(severity, pfx, msg); if (severity & ERR_USAGE) want_usage = true; diff --git a/asm/preproc.c b/asm/preproc.c index 48840a32..5f37b00b 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -1264,9 +1264,13 @@ static char *detoken(Token * tlist, bool expand_locals) if (!p) { nasm_error(ERR_NONFATAL | ERR_PASS1, "nonexistent environment variable `%s'", v); - p = ""; - } - t->text = nasm_strdup(p); + /* + * FIXME We better should investigate if accessing + * ->text[1] without ->text[0] is safe enough. + */ + t->text = nasm_zalloc(2); + } else + t->text = nasm_strdup(p); } nasm_free(q); }