From fca046e372a9db8bb87818a5760785b8ec62284f Mon Sep 17 00:00:00 2001 From: uqs Date: Wed, 2 Jun 2010 09:34:41 +0000 Subject: [PATCH] Zero struct before reading from it PR: 140384 Found by: clang static analyzer MFC after: 3 weeks --- bin/chio/chio.c | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/chio/chio.c b/bin/chio/chio.c index aaddb689d52f..16e88007011a 100644 --- a/bin/chio/chio.c +++ b/bin/chio/chio.c @@ -1072,6 +1072,7 @@ find_element(char *voltag, uint16_t *et, uint16_t *eu) /* Read in the changer slots */ if (cp.cp_nslots > 0) { + (void) memset(&cesr, 0, sizeof(cesr)); cesr.cesr_element_type = CHET_ST; cesr.cesr_element_base = 0; cesr.cesr_element_count = cp.cp_nslots;