mirror of
https://github.com/netwide-assembler/nasm.git
synced 2024-11-21 03:14:19 +08:00
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 <pushbx@ulukai.org> Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
18f4134222
commit
f770ce8be4
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user