[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <fe41fe45-0b3e-bac4-2d87-3241122b4730@huawei.com>
Date: Fri, 3 Dec 2021 14:30:31 +0800
From: zhanchengbin <zhanchengbin1@...wei.com>
To: Theodore Ts'o <tytso@....edu>
CC: <linux-ext4@...r.kernel.org>, <liuzhiqiang26@...wei.com>,
<linfeilong@...wei.com>
Subject: [PATCH 5/6] e2fsck: check whether ldesc is null before accessing it
in end_problem_latch()
In end_problem_latch(), ldesc need check not NULL before dereference.
Signed-off-by: zhanchengbin <zhanchengbin1@...wei.com>
---
e2fsck/problem.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/e2fsck/problem.c b/e2fsck/problem.c
index f454dcb7..fd814f9e 100644
--- a/e2fsck/problem.c
+++ b/e2fsck/problem.c
@@ -2394,6 +2394,8 @@ int end_problem_latch(e2fsck_t ctx, int mask)
int answer = -1;
ldesc = find_latch(mask);
+ if (!ldesc)
+ return answer;
if (ldesc->end_message && (ldesc->flags & PRL_LATCHED)) {
clear_problem_context(&pctx);
answer = fix_problem(ctx, ldesc->end_message, &pctx);
--
2.23.0
Powered by blists - more mailing lists