diff options
author | Kirk McKusick <mckusick@FreeBSD.org> | 2023-10-20 22:14:46 +0000 |
---|---|---|
committer | Kirk McKusick <mckusick@FreeBSD.org> | 2023-10-28 21:09:36 +0000 |
commit | 0bd8274c8529145fb1cba77b538291545cd34c39 (patch) | |
tree | 6fb0cdcf846d6dd004138c89c4515d0943ac5625 | |
parent | 9db5ae255127e4b897d777d0a2fe22843644ceba (diff) | |
download | src-0bd8274c8529145fb1cba77b538291545cd34c39.tar.gz src-0bd8274c8529145fb1cba77b538291545cd34c39.zip |
Fix a bug in fsck_ffs(8) triggered by corrupted filesystems.
Reported-by: Andreas Bock
PR: 274404
(cherry picked from commit 1e39a0886e0999520a7e7136e3f7d09e9cd9a5f2)
-rw-r--r-- | sbin/fsck_ffs/setup.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sbin/fsck_ffs/setup.c b/sbin/fsck_ffs/setup.c index 49e89f9221b0..d1d09d07b43a 100644 --- a/sbin/fsck_ffs/setup.c +++ b/sbin/fsck_ffs/setup.c @@ -299,6 +299,8 @@ checksnapinfo(struct inode *snapip) size = fragroundup(fs, DIP(snapip->i_dp, di_size) - lblktosize(fs, lbn)); bp = getdatablk(idesc.id_parent, size, BT_DATA); + if (bp->b_errs != 0) + return (0); snapblklist = (daddr_t *)bp->b_un.b_buf; /* * snapblklist[0] is the size of the list |