Skip to content

Commit 8fcc785

Browse files
zhangrf2020H. Peter Anvin
authored andcommitted
preproc: fix memory leak (and possibly CVEs?)
case PP_ENDM: case PP_ENDMACRO: if (!(defining && defining->name)) { nasm_nonfatal("`%s': not defining a macro", tok_text(tline)); goto done; } mmhead = (MMacro **) hash_findi_add(&mmacros, defining->name); defining->next = *mmhead; *mmhead = defining; defining = NULL; break; The variable: mmacros has not been released, which will cause a memory leak. Repair cve-2021-33450 cve-2021-33452 synchronously Signed-off-by: H. Peter Anvin <hpa@zytor.com>
1 parent 0582a32 commit 8fcc785

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

asm/preproc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4861,6 +4861,7 @@ static int do_directive(Token *tline, Token **output)
48614861
}
48624862

48634863
done:
4864+
free_mmacro_table(&mmacros);
48644865
free_tlist(origline);
48654866
return DIRECTIVE_FOUND;
48664867
}

0 commit comments

Comments
 (0)