Windows: uninitialized variable in cm_GetBuffer
authorJeffrey Altman <jaltman@secure-endpoints.com>
Sun, 20 Sep 2009 15:06:07 +0000 (11:06 -0400)
committerJeffrey Altman <jaltman|account-1000011@unknown>
Sun, 20 Sep 2009 15:09:34 +0000 (08:09 -0700)
Initialize code and code1 to zero.  Otherwise, a non-zero
value on the stack can result in an incorrect error value
being passed to cm_Analyze().

LICENSE MIT

Reviewed-on: http://gerrit.openafs.org/473
Tested-by: Jeffrey Altman <jaltman@openafs.org>
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

src/WINNT/afsd/cm_dcache.c

index ab5411e..dc7ca1b 100644 (file)
@@ -1389,7 +1389,7 @@ void cm_ReleaseBIOD(cm_bulkIO_t *biop, int isStore, long code, int scp_locked)
 long cm_GetBuffer(cm_scache_t *scp, cm_buf_t *bufp, int *cpffp, cm_user_t *userp,
                   cm_req_t *reqp)
 {
-    long code, code1;
+    long code=0, code1=0;
     afs_uint32 nbytes;                 /* bytes in transfer */
     afs_uint32 nbytes_hi = 0;            /* high-order 32 bits of bytes in transfer */
     afs_uint64 length_found = 0;