From 21166744bf15f13bc04c25d68a28fe803a960b0a 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) Change-Id: I3e039ffcb102a97afeb0e2223de12523f53b0a67 Reviewed-on: http://gerrit.openafs.org/9548 Reviewed-by: Derrick Brashear Reviewed-by: Jeffrey Altman Tested-by: BuildBot --- src/butc/dump.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/butc/dump.c b/src/butc/dump.c index c0d96957b..7c836a654 100644 --- a/src/butc/dump.c +++ b/src/butc/dump.c @@ -1859,6 +1859,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