diff options
author | Jon Schlueter <jschlueter@navigationsolutions.com> | 2015-01-07 15:26:26 -0500 |
---|---|---|
committer | Jon Schlueter <jschlueter@navigationsolutions.com> | 2015-01-07 16:05:04 -0500 |
commit | 2dcb15d10f9a004c88ddaf5172158eedd9cc3438 (patch) | |
tree | 6c71a16245753734c713c1857773d979e5019099 /gpsutils.c | |
parent | 06a5ac96a464799a141ce517697a68523591eb90 (diff) | |
download | gpsd-2dcb15d10f9a004c88ddaf5172158eedd9cc3438.tar.gz |
Fixup iso8601_to_unix uninitialized memory bug
Initialize struct tm before passing it to strptime
The issue is that mktime uses tm_isdst but some versions of strptime
don't actually set tm_isdst so you get an uninitialized memory behavior
at that point
Diffstat (limited to 'gpsutils.c')
-rw-r--r-- | gpsutils.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -345,6 +345,7 @@ timestamp_t iso8601_to_unix( /*@in@*/ char *isotime) char *dp = NULL; double usec; struct tm tm; + memset(&tm,0,sizeof(tm)); /*@i1@*/ dp = strptime(isotime, "%Y-%m-%dT%H:%M:%S", &tm); if (dp != NULL && *dp == '.') |