svn commit: r329883 - stable/10/sbin/fsck_ffs
Kirk McKusick
mckusick at FreeBSD.org
Fri Feb 23 23:07:42 UTC 2018
Author: mckusick
Date: Fri Feb 23 23:07:41 2018
New Revision: 329883
URL: https://svnweb.freebsd.org/changeset/base/329883
Log:
MFC of 329749.
Fix a read past the end of a buffer in fsck.
Modified:
stable/10/sbin/fsck_ffs/inode.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sbin/fsck_ffs/inode.c
==============================================================================
--- stable/10/sbin/fsck_ffs/inode.c Fri Feb 23 22:51:51 2018 (r329882)
+++ stable/10/sbin/fsck_ffs/inode.c Fri Feb 23 23:07:41 2018 (r329883)
@@ -451,8 +451,10 @@ cacheino(union dinode *dp, ino_t inumber)
if (howmany(DIP(dp, di_size), sblock.fs_bsize) > NDADDR)
blks = NDADDR + NIADDR;
- else
+ else if (DIP(dp, di_size) > 0)
blks = howmany(DIP(dp, di_size), sblock.fs_bsize);
+ else
+ blks = 1;
inp = (struct inoinfo *)
Malloc(sizeof(*inp) + (blks - 1) * sizeof(ufs2_daddr_t));
if (inp == NULL)
More information about the svn-src-all
mailing list