Fix null-pointer-dereference in yasm_expr_get_intnum (#244)

This commit is contained in:
dataisland 2023-09-22 00:21:20 -05:00 committed by GitHub
parent ecb47f1c87
commit 9defefae9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1264,7 +1264,7 @@ yasm_expr_get_intnum(yasm_expr **ep, int calc_bc_dist)
{
*ep = yasm_expr_simplify(*ep, calc_bc_dist);
if ((*ep)->op == YASM_EXPR_IDENT && (*ep)->terms[0].type == YASM_EXPR_INT)
if (*ep && (*ep)->op == YASM_EXPR_IDENT && (*ep)->terms[0].type == YASM_EXPR_INT)
return (*ep)->terms[0].data.intn;
else
return (yasm_intnum *)NULL;