[nasm:nasm-2.15.xx] BR3392712: pp_tokline: fix double free

nasm-bot for Cyrill Gorcunov gorcunov at gmail.com
Mon Aug 17 11:33:10 PDT 2020


Commit-ID:  8806c3ca007b84accac21dd88b900fb03614ceb7
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=8806c3ca007b84accac21dd88b900fb03614ceb7
Author:     Cyrill Gorcunov <gorcunov at gmail.com>
AuthorDate: Mon, 17 Aug 2020 21:30:14 +0300
Committer:  Cyrill Gorcunov <gorcunov at gmail.com>
CommitDate: Mon, 17 Aug 2020 21:30:14 +0300

BR3392712: pp_tokline: fix double free

Make sure the data being freed get double
freed after -- the pointers must be zapped
(actually nasm_free and free_tlist support
being called with NULL pointer as an argument).

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>


---
 asm/preproc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/asm/preproc.c b/asm/preproc.c
index b46ec17d..b25f275e 100644
--- a/asm/preproc.c
+++ b/asm/preproc.c
@@ -6751,6 +6751,9 @@ static Token *pp_tokline(void)
                         free_tlist(m->iline);
                         nasm_free(m->paramlen);
                         fm->in_progress = 0;
+			m->params = NULL;
+			m->iline = NULL;
+			m->paramlen = NULL;
                     }
                 }
 


More information about the Nasm-commits mailing list