Possible null pointer dereference fix.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 30 Mar 2010 03:30:09 +0000 (20:30 -0700)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Tue, 30 Mar 2010 03:30:09 +0000 (20:30 -0700)
nfs3/nfs3.c

index ec5c736..f7e7b4e 100644 (file)
@@ -996,8 +996,8 @@ void nfsproc3_readdirplus_3_svc(readdirplus3args *argp, RPCRequest *req)
     while (count < MAX_READDIR_DIRENTS && !g_sequence_iter_is_end(i)) {
         BlueSkyDirent *d = g_sequence_get(i);
         BlueSkyInode *inode = bluesky_get_inode(fs, d->inum);
-        g_mutex_lock(inode->lock);
         if (inode != NULL) {
+            g_mutex_lock(inode->lock);
             dircount += 24 + ((strlen(d->name) + 3) & ~3);
             attrcount += 88 + 8 + 8;
             if (dircount > argp->dircount