From: nasm-bot f. C. G. <gor...@gm...> - 2017-10-22 18:44:13
|
Commit-ID: 9b7ee09abfd426b99aa1ea81d19a3b2818eeabf9 Gitweb: http://repo.or.cz/w/nasm.git?a=commitdiff;h=9b7ee09abfd426b99aa1ea81d19a3b2818eeabf9 Author: Cyrill Gorcunov <gor...@gm...> AuthorDate: Sun, 22 Oct 2017 21:42:59 +0300 Committer: Cyrill Gorcunov <gor...@gm...> CommitDate: Sun, 22 Oct 2017 21:42:59 +0300 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 <gor...@gm...> --- asm/preproc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/asm/preproc.c b/asm/preproc.c index 9642edc..475926d 100644 --- a/asm/preproc.c +++ b/asm/preproc.c @@ -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; |