diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-06-16 11:14:12 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-06-16 11:14:12 -0400 |
commit | 9b0bd65f220854b7335acca020c73dc075b379a3 (patch) | |
tree | 2ab4cafbcc96bf77e5d9df7ea5895ec18897b66c | |
parent | 79370914d1a88adde03dc514bf94fc3e6c3c030c (diff) | |
download | tor-9b0bd65f220854b7335acca020c73dc075b379a3.tar.gz tor-9b0bd65f220854b7335acca020c73dc075b379a3.zip |
I believe I found some dead code in our time parsing functions
-rw-r--r-- | src/common/util.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/common/util.c b/src/common/util.c index 884d74f71b..0589cec8e6 100644 --- a/src/common/util.c +++ b/src/common/util.c @@ -1629,11 +1629,16 @@ parse_rfc1123_time(const char *buf, time_t *t) tm.tm_sec = (int)tm_sec; if (tm.tm_year < 1970) { + /* LCOV_EXCL_START + * XXXX I think this is dead code; we already checked for + * invalid_year above. */ + tor_assert_nonfatal_unreached(); char *esc = esc_for_log(buf); log_warn(LD_GENERAL, "Got invalid RFC1123 time %s. (Before 1970)", esc); tor_free(esc); return -1; + /* LCOV_EXCL_STOP */ } tm.tm_year -= 1900; @@ -1717,10 +1722,15 @@ parse_iso_time_(const char *cp, time_t *t, int strict) st_tm.tm_wday = 0; /* Should be ignored. */ if (st_tm.tm_year < 70) { + /* LCOV_EXCL_START + * XXXX I think this is dead code; we already checked for + * year < 1970 above. */ + tor_assert_nonfatal_unreached(); char *esc = esc_for_log(cp); log_warn(LD_GENERAL, "Got invalid ISO time %s. (Before 1970)", esc); tor_free(esc); return -1; + /* LCOV_EXCL_STOP */ } return tor_timegm(&st_tm, t); } |