Date: Fri, 11 Mar 2005 09:23:35 -0800 From: Sam Leffler <sam@errno.com> To: fs@freebsd.org Subject: dirhash potential bug Message-ID: <4231D417.9060705@errno.com>
next in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format.
--------------060406040607070405040007
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Coverity's analysis tool claims there might be a null bp dereferenced in
ufsdirhash_lookup. Attached is a patch to add a KASSERT but it'd be
good for someone more familiar with the code to check if a change is
required.
Sam
--------------060406040607070405040007
Content-Type: text/plain;
name="dirhash.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="dirhash.patch"
==== //depot/projects/wifi/sys/ufs/ufs/ufs_dirhash.c#3 - /usr/sam/wifi/sys/ufs/ufs/ufs_dirhash.c ====
@@ -420,6 +420,7 @@
if (UFS_BLKATOFF(vp, (off_t)blkoff, NULL, &bp) != 0)
return (EJUSTRETURN);
}
+ KASSERT(bp != NULL, ("no buf?"));
dp = (struct direct *)(bp->b_data + (offset & bmask));
if (dp->d_reclen == 0 || dp->d_reclen >
DIRBLKSIZ - (offset & (DIRBLKSIZ - 1))) {
--------------060406040607070405040007--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4231D417.9060705>
