From f5a48a6ba25a4d96d1204e9a2ba9faf246a7de7c Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sat, 24 Nov 2018 12:02:13 +0300 Subject: [PATCH] Fix sigsegv if two outputs specified outname is only set up by pass two so earlier access may lead to sigsegv. Signed-off-by: Cyrill Gorcunov --- asm/nasm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/asm/nasm.c b/asm/nasm.c index c7d5e3c6..25ac36c6 100644 --- a/asm/nasm.c +++ b/asm/nasm.c @@ -1743,7 +1743,9 @@ static void nasm_verror_gnu(int severity, const char *fmt, va_list ap) if (!(severity & ERR_NOFILE)) { src_get(&lineno, ¤tfile); if (!currentfile || (severity & ERR_TOPFILE)) { - currentfile = inname[0] ? inname : outname[0] ? outname : NULL; + currentfile = inname && inname[0] ? + inname : outname && outname[0] ? + outname : NULL; lineno = 0; } }