From 2a2434e0cc91492ce56ce4360aacb7737bb1eebe Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 14 Feb 2017 20:29:38 +0000 Subject: [PATCH] wintime: add a precautionary memset to zero. Coverity observes that sometimes 'struct tm' can have other fields (e.g. glibc's tm_gmtoff), so it's as well to make sure we initialise the whole thing to zero. --- windows/wintime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/windows/wintime.c b/windows/wintime.c index eebed9e5..5fa3b0de 100644 --- a/windows/wintime.c +++ b/windows/wintime.c @@ -10,6 +10,8 @@ struct tm ltime(void) SYSTEMTIME st; struct tm tm; + memset(&tm, 0, sizeof(tm)); /* in case there are any other fields */ + GetLocalTime(&st); tm.tm_sec=st.wSecond; tm.tm_min=st.wMinute; -- 2.45.1