diff --git a/NEWS.md b/NEWS.md index b14e6729..e8112478 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,8 @@ ### SSLsplit develop +- Fix session cache misses and failed unit tests on MIPS by fixing undefined + behaviour in session cache hash functions (Debian #848919 and #851271). - Synthesize MAC addresses to avoid the requirement for root privileges and waiting for ARP timeouts on some platforms in log2pcap.py (issue #169). - Add -M for writing an SSLKEYLOGFILE compatible log file (issue #184). diff --git a/cachedsess.c b/cachedsess.c index 3395fd63..ee1dbcbc 100644 --- a/cachedsess.c +++ b/cachedsess.c @@ -44,13 +44,11 @@ static inline khint_t kh_dynbuf_hash_func(dynbuf_t *b) { khint_t *p = (khint_t *)b->buf; - khint_t h; + khint_t h = 0; int rem; if ((rem = b->sz % sizeof(khint_t))) { memcpy(&h, b->buf + b->sz - rem, rem); - } else { - h = 0; } while (p < (khint_t*)(b->buf + b->sz - rem)) { diff --git a/cachessess.c b/cachessess.c index 4896ed0b..e74970ba 100644 --- a/cachessess.c +++ b/cachessess.c @@ -42,13 +42,11 @@ static inline khint_t kh_dynbuf_hash_func(dynbuf_t *b) { khint_t *p = (khint_t *)b->buf; - khint_t h; + khint_t h = 0; int rem; if ((rem = b->sz % sizeof(khint_t))) { memcpy(&h, b->buf + b->sz - rem, rem); - } else { - h = 0; } while (p < (khint_t*)(b->buf + b->sz - rem)) {