ostree/parse-datetime: Ensure tm structs are initialised

Otherwise tm.tm_wday remains uninitialised and gets propagated
elsewhere.

Spotted by Coverity as issue #209265.

Signed-off-by: Philip Withnall <withnall@endlessm.com>

Closes: #1059
Approved by: cgwalters
This commit is contained in:
Philip Withnall 2017-08-07 14:13:30 +01:00 committed by Atomic Bot
parent e9b9123bae
commit 86dce4b252
1 changed files with 2 additions and 2 deletions

View File

@ -1280,8 +1280,8 @@ parse_datetime (struct timespec *result, char const *p,
time_t Start;
long int Start_ns;
struct tm const *tmp;
struct tm tm;
struct tm tm0;
struct tm tm = { 0, };
struct tm tm0 = { 0, };
parser_control pc;
struct timespec gettime_buffer;
unsigned char c;