commit | 9defefae9fbcb6958cddbfa778c1ea8605da8b8b | [log] [tgz] |
---|---|---|
author | dataisland <dataisland@outlook.com> | Fri Sep 22 00:21:20 2023 -0500 |
committer | GitHub <noreply@github.com> | Thu Sep 21 22:21:20 2023 -0700 |
tree | d2d6c615929e5b6400105066de552ff7c7bfaffb | |
parent | ecb47f1c8786b4628d5cd718cdccf134ad96e0cb [diff] |
Fix null-pointer-dereference in yasm_expr_get_intnum (#244)
diff --git a/libyasm/expr.c b/libyasm/expr.c index 5b0c418..09ae112 100644 --- a/libyasm/expr.c +++ b/libyasm/expr.c
@@ -1264,7 +1264,7 @@ { *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;