From: Darrick J. Wong Date: Mon, 12 May 2014 03:33:08 +0000 (-0400) Subject: resize2fs: fix sanity check in reserve_sparse_super2_last_group() X-Git-Tag: v1.42.10~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1244cacc7093ef612b164ff35b2410a7fc3aefce;p=thirdparty%2Fe2fsprogs.git resize2fs: fix sanity check in reserve_sparse_super2_last_group() In reserve_sparse_super2_last_group, the old_desc check should only be performed if ext2fs_super_and_bgd_loc2() gave us a location -- a return value of 0 means that there is no old-style GDT block. Signed-off-by: Darrick J. Wong Signed-off-by: Theodore Ts'o --- diff --git a/resize/resize2fs.c b/resize/resize2fs.c index c672cdbe0..e528f6274 100644 --- a/resize/resize2fs.c +++ b/resize/resize2fs.c @@ -2047,7 +2047,7 @@ static errcode_t reserve_sparse_super2_last_group(ext2_resize_t rfs, stderr); exit(1); } - if (old_desc != sb+1) { + if (old_desc && old_desc != sb+1) { fputs(_("Should never happen! Unexpected old_desc in " "super_sparse bg?\n"), stderr);