From ea41284998daf106f96112ae3d66226233e86f5a Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Thu, 11 Feb 2021 23:47:32 -0500 Subject: [PATCH] e2fsck: add error checking for ext2fs_extent_get_info() This function can't actually fail today, but in the future it could return an error, so it's better to add the appropriate error check. Addresses-Coverity-Bug: #1464579 Signed-off-by: Theodore Ts'o --- e2fsck/pass1.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index a1e24e5..9d43089 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -3027,7 +3027,12 @@ report_problem: if (extent.e_lblk != lblk) { struct ext2_extent_info e_info; - ext2fs_extent_get_info(ehandle, &e_info); + pctx->errcode = ext2fs_extent_get_info(ehandle, + &e_info); + if (pctx->errcode) { + pctx->str = "ext2fs_extent_get_info"; + return; + } pctx->blk = lblk; pctx->blk2 = extent.e_lblk; pctx->num = e_info.curr_level - 1; -- 1.8.3.1