OPENAFS-SA-2018-002 butc: Initialize OUT scalar value
authorBenjamin Kaduk <kaduk@mit.edu>
Thu, 30 Aug 2018 15:38:56 +0000 (10:38 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Sun, 9 Sep 2018 22:34:10 +0000 (17:34 -0500)
In STC_ReadLabel, the interaction with the tape device is
synchronous, so there is no need to allocate a task ID for status
monitoring.  However, we do need to initialize the output value,
to avoid writing stack garbage on the wire.

Change-Id: Id2066e1fe95fa1de02577dfd844697b1ae770f30

src/butc/tcprocs.c

index 7154a18..cc19e53 100644 (file)
@@ -373,6 +373,8 @@ STC_ReadLabel(struct rx_call *acid, struct tc_tapeLabel *label, afs_uint32 *task
     afs_int32 code;
 
     memset(label, 0, sizeof(*label));
+    /* Synchronous, so no "real" ID; don't send stack garbage on the wire */
+    *taskId = 0;
 #ifdef xbsa
     if (CONF_XBSA)
        return (TC_BADTASK);    /* ReadLabel does not apply if XBSA */