yasm/CVE-2021-33454.patch
Funda Wang cdb0e78f61 fix CVE-2021-33454, CVE-2021-33464, CVE-2023-29579
(cherry picked from commit 7aec1c83b4bfa6438582630d51dfd9ceaa9059b2)
2025-05-13 09:41:02 +08:00

23 lines
812 B
Diff

From 9defefae9fbcb6958cddbfa778c1ea8605da8b8b Mon Sep 17 00:00:00 2001
From: dataisland <dataisland@outlook.com>
Date: Fri, 22 Sep 2023 00:21:20 -0500
Subject: [PATCH] Fix null-pointer-dereference in yasm_expr_get_intnum (#244)
---
libyasm/expr.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libyasm/expr.c b/libyasm/expr.c
index 5b0c418b..09ae1121 100644
--- a/libyasm/expr.c
+++ b/libyasm/expr.c
@@ -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;