From: nasm-bot f. C. G. <gor...@gm...> - 2018-11-24 09:15:22
|
Commit-ID: f5a48a6ba25a4d96d1204e9a2ba9faf246a7de7c Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=f5a48a6ba25a4d96d1204e9a2ba9faf246a7de7c Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sat, 24 Nov 2018 12:02:13 +0300 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sat, 24 Nov 2018 12:02:13 +0300 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 <gor...@gm...> --- asm/nasm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/asm/nasm.c b/asm/nasm.c index c7d5e3c..25ac36c 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; } } |