Fix nullptr deref in yasm_expr__copy_except (#241)

This commit is contained in:
dataisland 2023-09-22 00:04:21 -05:00 committed by GitHub
parent 721134a8ae
commit 0dfac4d4da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -994,7 +994,10 @@ yasm_expr__copy_except(const yasm_expr *e, int except)
{
yasm_expr *n;
int i;
if (e == NULL)
return NULL;
n = yasm_xmalloc(sizeof(yasm_expr) +
sizeof(yasm_expr__item)*(e->numterms<2?0:e->numterms-2));