From 6f8109ebf18e3de69a8a2ad63867fe8498e49bf0 Mon Sep 17 00:00:00 2001 From: Cyrill Gorcunov Date: Sun, 22 Oct 2017 21:26:36 +0300 Subject: [PATCH] preproc: Fix SIGSEGV if not data provided for implicit pasting https://bugzilla.nasm.us/show_bug.cgi?id=3392423 Signed-off-by: Cyrill Gorcunov --- asm/preproc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/asm/preproc.c b/asm/preproc.c index 43b62aa7..9642edcb 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -3848,8 +3848,8 @@ static bool paste_tokens(Token **head, const struct tokseq_match *m, next = next->next; } - /* No match */ - if (tok == next) + /* No match or no text to process */ + if (tok == next || len == 0) break; len += strlen(tok->text); -- 2.11.4.GIT