From 2390eb68266fbe5bf76cab36cf1e357a6d51aabb Mon Sep 17 00:00:00 2001 From: goldsimon Date: Tue, 13 Feb 2018 12:47:00 +0100 Subject: [PATCH] vj_compress_tcp: help coverity to see we're not accessing out of bounds (this is a union) --- 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 62dbf54d..5f2dd15a 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_ip + 1, (deltaS - 5) << 2)) + || (deltaS > 5 && BCMP(ip + 1, &cs->cs_hdr[sizeof(struct ip_hdr)], (deltaS - 5) << 2)) || (TCPH_HDRLEN(th) > 5 && BCMP(th + 1, oth + 1, (TCPH_HDRLEN(th) - 5) << 2))) { goto uncompressed; }