diff options
author | Philip Withnall <withnall@endlessm.com> | 2017-08-07 14:13:30 +0100 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-08-08 14:11:07 +0000 |
commit | 86dce4b252005949a4f9a4f7b4666982b12a84d4 (patch) | |
tree | 62013b0b7e8603489fc77d95c476e253859870f4 | |
parent | e9b9123bae755c91c9a0cddc4c9cdb8383267f75 (diff) | |
download | ostree-86dce4b252005949a4f9a4f7b4666982b12a84d4.tar.gz |
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
-rw-r--r-- | src/ostree/parse-datetime.y | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ostree/parse-datetime.y b/src/ostree/parse-datetime.y index f5688d30..50917354 100644 --- a/src/ostree/parse-datetime.y +++ b/src/ostree/parse-datetime.y @@ -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; |