From 546a8c4860d0b7d38150f2c329962a9ee6dfaf04 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 14 Feb 2018 07:34:05 +0100 Subject: [PATCH] Revert "vj_compress_tcp: help coverity to see we're not accessing out of bounds (this is a union)" This reverts commit 2390eb68266fbe5bf76cab36cf1e357a6d51aabb. I've already marked other issues like this as 'invalid', so do this here, too. Although I don't like the code, there's not much use in fixing this in one place only. --- src/netif/ppp/vj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/netif/ppp/vj.c b/src/netif/ppp/vj.c index 5f2dd15a..62dbf54d 100644 --- a/src/netif/ppp/vj.c +++ b/src/netif/ppp/vj.c @@ -289,7 +289,7 @@ vj_compress_tcp(struct vjcompress *comp, struct pbuf **pb) || (((struct vj_u16_t*)ip)[3]).v != (((struct vj_u16_t*)&cs->cs_ip)[3]).v || (((struct vj_u16_t*)ip)[4]).v != (((struct vj_u16_t*)&cs->cs_ip)[4]).v || TCPH_HDRLEN(th) != TCPH_HDRLEN(oth) - || (deltaS > 5 && BCMP(ip + 1, &cs->cs_hdr[sizeof(struct ip_hdr)], (deltaS - 5) << 2)) + || (deltaS > 5 && BCMP(ip + 1, &cs->cs_ip + 1, (deltaS - 5) << 2)) || (TCPH_HDRLEN(th) > 5 && BCMP(th + 1, oth + 1, (TCPH_HDRLEN(th) - 5) << 2))) { goto uncompressed; }