From: nasm-bot f. C. G. <gor...@gm...> - 2018-10-28 17:42:15
|
Commit-ID: 661f723d39e03ca6eb05d7376a43ca33db478354 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=661f723d39e03ca6eb05d7376a43ca33db478354 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sun, 28 Oct 2018 20:39:34 +0300 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 28 Oct 2018 20:39:34 +0300 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 <gan...@gm...> Signed-off-by: Cyrill Gorcunov <gor...@gm...> --- asm/preproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/asm/preproc.c b/asm/preproc.c index 0174c9a..9034135 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -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] == '%')) { |