If ext2fs_extent_open() fails due to a corrupt extent header, and the
user declines to clear the inode, check_blocks_extents() should bail
out; otherwise, it will cause a core dump due a null pointer
dereference.
Addresses-Sourceforge-Bug: #2791794
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
errcode_t retval;
pctx->errcode = ext2fs_extent_open(fs, ino, &ehandle);
- if (pctx->errcode &&
- fix_problem(ctx, PR_1_READ_EXTENT, pctx)) {
- e2fsck_clear_inode(ctx, ino, inode, 0, "check_blocks_extents");
+ if (pctx->errcode) {
+ if (fix_problem(ctx, PR_1_READ_EXTENT, pctx))
+ e2fsck_clear_inode(ctx, ino, inode, 0,
+ "check_blocks_extents");
pctx->errcode = 0;
return;
}