Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Jun 2000 02:20:17 +0200 (CEST)
From:      Marius Bendiksen <mbendiks@eunet.no>
To:        hackers@freebsd.org
Subject:   buffer cache question
Message-ID:  <Pine.BSF.4.05.10006280215070.14273-100000@login-1.eunet.no>

next in thread | raw e-mail | index | archive | help
In the following code, from /sys/kern/vfs_bio.c : bread(), it appears to
me that it is possible for a null pointer to be deferenced?

        struct buf *bp;

        bp = getblk(vp, blkno, size, 0, 0);
        *bpp = bp;

        /* if not found in cache, do some I/O */
        if ((bp->b_flags & B_CACHE) == 0) {
 
It seems, from a very brief inspection of the code, as though getblk()
might return a null pointer under certain circumstances. I'd expect my
understanding of the code is flawed,  as such a thing should have been
discovered ages ago, were it a bug, but I feel I should ask.

Marius



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.10006280215070.14273-100000>