diff options
author | Theodore Ts'o <tytso@mit.edu> | 2021-02-11 23:47:32 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2021-02-11 23:47:32 -0500 |
commit | ea41284998daf106f96112ae3d66226233e86f5a (patch) | |
tree | a296a366e366e4262555cb93c66ac8ff4a3f28f6 | |
parent | 33b9a60c366da5df92d9c1b003aedaf1d0e2008a (diff) | |
download | e2fsprogs-ea41284998daf106f96112ae3d66226233e86f5a.tar.gz |
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 <tytso@mit.edu>
-rw-r--r-- | e2fsck/pass1.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index a1e24e5bc..9d4308956 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; |