summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2017-10-22 21:26:36 +0300
committerCyrill Gorcunov <gorcunov@gmail.com>2017-10-22 21:26:36 +0300
commit6f8109ebf18e3de69a8a2ad63867fe8498e49bf0 (patch)
tree07f5dac93bedf59a391dfb229ce4aaa3e33042f2
parent7524cfd91492e6e3719b959498be584a9ced13af (diff)
downloadnasm-6f8109ebf18e3de69a8a2ad63867fe8498e49bf0.tar.gz
preproc: Fix SIGSEGV if not data provided for implicit pasting
https://bugzilla.nasm.us/show_bug.cgi?id=3392423 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
-rw-r--r--asm/preproc.c4
1 files 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);