Skip to content

Commit

Permalink
ts2phc: Fix uninitialized variable in nmea_scan_rmc
Browse files Browse the repository at this point in the history
tm_isdst needs to be initialized to make sure mktime does not fail
on recent versions of glibc

See:
https://bugzilla.redhat.com/show_bug.cgi?id=1653340
https://sourceware.org/bugzilla/show_bug.cgi?id=24630

Signed-off-by: Lars Munch <[email protected]>
  • Loading branch information
lmunch authored and richardcochran committed Jul 19, 2021
1 parent d61d77e commit 63fc1ef
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions nmea.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ static int nmea_scan_rmc(struct nmea_parser *np, struct nmea_rmc *result)
}
tm.tm_year += 100;
tm.tm_mon--;
tm.tm_isdst = 0;
result->ts.tv_sec = mktime(&tm);
result->ts.tv_nsec = msec * 1000000UL;
result->fix_valid = status == 'A' ? true : false;
Expand Down

0 comments on commit 63fc1ef

Please sign in to comment.