mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
preproc: Fix out of bound access on malformed input
A fuzzer revealed a problem in preproc code. https://bugzilla.nasm.us/show_bug.cgi?id=3392521 Reported-by: ganshuitao <ganshuitao@gmail.com> Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
This commit is contained in:
parent
fe2e1d469a
commit
661f723d39
@ -4002,7 +4002,7 @@ static Token *expand_mmac_params(Token * tline)
|
||||
thead = NULL;
|
||||
|
||||
while (tline) {
|
||||
if (tline->type == TOK_PREPROC_ID &&
|
||||
if (tline->type == TOK_PREPROC_ID && tline->text && tline->text[0] &&
|
||||
(((tline->text[1] == '+' || tline->text[1] == '-') && tline->text[2]) ||
|
||||
(tline->text[1] >= '0' && tline->text[1] <= '9') ||
|
||||
tline->text[1] == '%')) {
|
||||
|
Loading…
Reference in New Issue
Block a user