From 6cdeb497923b11b94de08a32f784c04871a25970 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Mon, 4 Mar 2013 16:34:20 +0000 Subject: [PATCH] butc: Init volheader before using it for hton When converting a volume header from host to network order, make sure that any unused fields in the structure are zero'd, so we don't end up filling them with stack garbage in the network version of the structure. Caught by coverity (#985956) Reviewed-on: http://gerrit.openafs.org/9548 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: BuildBot (cherry picked from commit 21166744bf15f13bc04c25d68a28fe803a960b0a) Change-Id: I7156cc51f52a8c9911d6ce087ba0a6b1cc0d9a9e Reviewed-on: http://gerrit.openafs.org/11065 Reviewed-by: Chas Williams - CONTRACTOR Tested-by: BuildBot Reviewed-by: Andrew Deason Reviewed-by: Stephan Wiesand --- src/butc/dump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/butc/dump.c b/src/butc/dump.c index 085355b19..9b1f7bb41 100644 --- a/src/butc/dump.c +++ b/src/butc/dump.c @@ -1888,6 +1888,8 @@ volumeHeader_hton(struct volumeHeader *hostPtr, struct volumeHeader *netPtr) { struct volumeHeader volHdr; + memset(&volHdr, 0, sizeof(volHdr)); + strcpy(volHdr.preamble, hostPtr->preamble); strcpy(volHdr.postamble, hostPtr->postamble); strcpy(volHdr.volumeName, hostPtr->volumeName); -- 2.39.5