From f770ce8be48f17b772c3a9c32b3da944e155f502 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Thu, 17 Oct 2019 18:22:43 -0700 Subject: preproc: reserve space for terminal NUL in %strcat Technically, this is not necessary, because make_tok_qstr_len() doesn't rely on NUL termination, and in fact it *can't*, since the string might contain embedded NULs, but tacking on a NUL is good for debugging if nothing else. That means reserving space for it! Reported-by: C. Masloch Signed-off-by: H. Peter Anvin (Intel) --- asm/preproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'asm') diff --git a/asm/preproc.c b/asm/preproc.c index c3353951..d966c10f 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -4234,7 +4234,7 @@ issue_error: } } - q = qbuf = nasm_malloc(len); + q = qbuf = nasm_malloc(len+1); list_for_each(t, tline) { if (t->type == TOK_INTERNAL_STRING) q = mempcpy(q, tok_text(t), t->len); -- cgit v1.2.1