diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-05-08 20:47:58 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-05-09 03:49:07 +0000 |
commit | 4513c66b1a2c7f7feb729e7e4e576b390395a123 (patch) | |
tree | 0140350b74ebe528dc179315b75745b5baf8a373 | |
parent | 270f0554d86ad5a7d6455f8eccbf057acdc69a91 (diff) |
You have to set tm_isdst before calling mktime().
You either need to tell mktime() that 1) DST/Summer Time is in effect,
2) DST/Summer Time isn't in effect, or 3) we don't know whether
DST/Summer Time is in effect, you figure it out.
We set tm_isdst to -1, to choose option 3), which is what we want.
Fixes Coverity CID 1435496.
Change-Id: I0f22ef1201ee8abefb3fa75aa3432b021fb13cfd
Reviewed-on: https://code.wireshark.org/review/27408
Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r-- | extcap/androiddump.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c index 0104228783..3d518fd63c 100644 --- a/extcap/androiddump.c +++ b/extcap/androiddump.c @@ -1578,6 +1578,7 @@ static int capture_android_bluetooth_hcidump(char *interface, char *fifo, date.tm_min, date.tm_sec, ms, direction_character); date.tm_mon -= 1; date.tm_year -= 1900; + date.tm_isdst = -1; ts = mktime(&date); new_hex_data = data + 29; @@ -2128,6 +2129,7 @@ static int capture_android_logcat_text(char *interface, char *fifo, if (6 == sscanf(packet + exported_pdu_headers_size, "%d-%d %d:%d:%d.%d", &date->tm_mon, &date->tm_mday, &date->tm_hour, &date->tm_min, &date->tm_sec, &ms)) { date->tm_mon -= 1; + date->tm_isdst = -1; seconds = mktime(date); secs = (time_t) seconds; nsecs = (int) (ms * 1e6); |