]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-null-pointer-20040809
authorJeffrey Altman <jaltman@mit.edu>
Mon, 9 Aug 2004 21:55:05 +0000 (21:55 +0000)
committerDerrick Brashear <shadow@dementia.org>
Mon, 9 Aug 2004 21:55:05 +0000 (21:55 +0000)
protect against a null pointer reference in smb_ReceiveV3Trans
when its the first packet and the totalData and totalParms are 0

(cherry picked from commit 3fd571cb1014f61101e0b82fc9944f9d5285cea1)

src/WINNT/afsd/smb3.c

index e9468b097d0db3462995e242b065e52be0f90f34..2f8b3241de09b39df0afb744a7a74b0c2fa88c08 100644 (file)
@@ -1305,7 +1305,9 @@ long smb_ReceiveV3Trans(smb_vc_t *vcp, smb_packet_t *inp, smb_packet_t *outp)
     asp->curParms += parmCount;
 
     /* finally, if we're done, remove the packet from the queue and dispatch it */
-    if (asp->totalData <= asp->curData && asp->totalParms <= asp->curParms) {
+    if (asp->curData > 0 && asp->curParms > 0 && 
+        asp->totalData <= asp->curData && 
+        asp->totalParms <= asp->curParms) {
                /* we've received it all */
         lock_ObtainWrite(&smb_globalLock);
                osi_QRemove((osi_queue_t **) &smb_tran2AssemblyQueuep, &asp->q);