summaryrefslogtreecommitdiff
path: root/driver_superstar2.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-01-24 07:08:24 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-01-24 07:08:24 -0500
commite69530bf805d34ef09f04dc503ef6765732bec8a (patch)
treeace40a814b3943fdfaf6b8d14065678199c95603 /driver_superstar2.c
parent774e5155394231588224bba44aa8a1a5218e9924 (diff)
downloadgpsd-e69530bf805d34ef09f04dc503ef6765732bec8a.tar.gz
Prevent uninitialized-field lossage in the Superstar driver.
Diffstat (limited to 'driver_superstar2.c')
-rw-r--r--driver_superstar2.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/driver_superstar2.c b/driver_superstar2.c
index f16f38d0..94cc3320 100644
--- a/driver_superstar2.c
+++ b/driver_superstar2.c
@@ -102,6 +102,7 @@ superstar2_msg_navsol_lla(struct gps_device_t *session,
tm.tm_mday = (int)getub(buf, 14);
tm.tm_mon = (int)getub(buf, 15) - 1;
tm.tm_year = (int)getleu16(buf, 16) - 1900;
+ tm.tm_isdst = 0;
session->newdata.time = (timestamp_t)mkgmtime(&tm) + (d - tm.tm_sec);
mask |= TIME_SET | PPSTIME_IS;
@@ -272,6 +273,7 @@ superstar2_msg_timing(struct gps_device_t *session, unsigned char *buf,
tm.tm_min = (int)getsb(buf, 42);
d = getled64((char *)buf, 43);
tm.tm_sec = (int)d;
+ tm.tm_isdst = 0;
session->newdata.time = (timestamp_t)mkgmtime(&tm);
session->context->leap_seconds = (int)getsb(buf, 20);
mask = TIME_SET | PPSTIME_IS;