mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
preproc: fix heap memory overflow CVE-2023-31722
paramlen has heap memory of length nparam+1. The value of variable i may be greater than nparam+1, causing heap memory overflow. Therefore, i and nparam+1 needs to be determined in the loop. Fixes: https://bugzilla.nasm.us/show_bug.cgi?id=3392857#c1 Fixes: https://github.com/netwide-assembler/nasm/pull/83 Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
parent
c651c28217
commit
e39b856bde
2 changed files with 4 additions and 2 deletions
|
|
@ -74,8 +74,10 @@ void *nasm_realloc(void *q, size_t size)
|
|||
|
||||
void nasm_free(void *q)
|
||||
{
|
||||
if (q)
|
||||
if (q){
|
||||
free(q);
|
||||
q = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
char *nasm_strdup(const char *s)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue