[OpenAFS-devel] avc dereferenced w/o checking for null.

Matthew Andrews matt@slackers.net
Mon, 17 Jun 2002 17:48:38 -0700


in src/afs/VNOPS/afs_vnop_read.c

in afs_UFSRead()
we check to see if avc is non-null, but at this point, avc has already 
been dereferenced.
this check does not seem to exist in MemRead().

I'm thinking that either this check should be moved earlier or is 
extraneous. any thoughts?

-Matthew Andrews

relevant excerpt(CVS-1.11.2.3 L596-604):

   AFS_STATCNT(afs_UFSRead);
    if (avc->vc_error)
        return EIO;

    /* check that we have the latest status info in the vnode cache */
    if ((code = afs_InitReq(&treq, acred))) return code;
    if (!noLock) {
      if (!avc)
           ^^^^ <---too late
        osi_Panic ("null avc in afs_UFSRead");
...