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 <gorcunov@gmail.com>
This commit is contained in:
Cyrill Gorcunov 2018-11-24 12:02:13 +03:00
parent 744100dc14
commit f5a48a6ba2

View File

@ -1743,7 +1743,9 @@ static void nasm_verror_gnu(int severity, const char *fmt, va_list ap)
if (!(severity & ERR_NOFILE)) {
src_get(&lineno, &currentfile);
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;
}
}