mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-25 18:10:23 +08:00
prepoc: Fix heap-buffer-overflow in detoken
Just make sure we've a data to process. https://bugzilla.nasm.us/show_bug.cgi?id=3392424 Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
6f8109ebf1
commit
9b7ee09abf
@ -1254,7 +1254,8 @@ static char *detoken(Token * tlist, bool expand_locals)
|
||||
int len = 0;
|
||||
|
||||
list_for_each(t, tlist) {
|
||||
if (t->type == TOK_PREPROC_ID && t->text[1] == '!') {
|
||||
if (t->type == TOK_PREPROC_ID && t->text &&
|
||||
t->text[0] && t->text[1] == '!') {
|
||||
char *v;
|
||||
char *q = t->text;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user