From 418b2ab56c60e44375df31a3a8f77461d577a5ff Mon Sep 17 00:00:00 2001 From: Benjamin Kaduk Date: Thu, 30 Aug 2018 10:38:56 -0500 Subject: [PATCH] OPENAFS-SA-2018-002 butc: Initialize OUT scalar value 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. (cherry picked from commit f5a80115f8f7f9418287547f0fc7fdb13d936f00) Change-Id: I3f5ea1cfff0d04adb49cdca7b05ac869665660e5 --- src/butc/tcprocs.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/butc/tcprocs.c b/src/butc/tcprocs.c index 7154a1843..cc19e532d 100644 --- a/src/butc/tcprocs.c +++ b/src/butc/tcprocs.c @@ -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 */ -- 2.39.5