fsck.cramfs: fix crash when superblock size is too small
This hopefully fixes the original problem addressed by the reverted patch7cb962c7
. The bug was introduced by myself inf991dbd3
"fsck.cramfs: allow smaller superblock sizes" CC: Tobias Stoeckmann <tobias@stoeckmann.org> Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This commit is contained in:
parent
919e372da8
commit
2374b1ab75
|
@ -192,7 +192,7 @@ static void test_super(int *start, size_t * length)
|
|||
errx(FSCK_EX_ERROR, _("unsupported filesystem features"));
|
||||
|
||||
/* What are valid superblock sizes? */
|
||||
if (super.size < sizeof(struct cramfs_super))
|
||||
if (super.size < *start + sizeof(struct cramfs_super))
|
||||
errx(FSCK_EX_UNCORRECTED, _("superblock size (%d) too small"),
|
||||
super.size);
|
||||
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
fsck.cramfs: file extends past end of filesystem
|
||||
fsck.cramfs: crc error
|
||||
fsck.cramfs: superblock size (76) too small
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# GNU General Public License for more details.
|
||||
#
|
||||
TS_TOPDIR="${0%/*}/../.."
|
||||
TS_DESC="fsck endianness"
|
||||
TS_DESC="fsck bad header"
|
||||
|
||||
. $TS_TOPDIR/functions.sh
|
||||
ts_init "$*"
|
||||
|
|
Loading…
Reference in New Issue