diff --git a/nfq2/darkmagic.c b/nfq2/darkmagic.c index 94da04b..0a9553e 100644 --- a/nfq2/darkmagic.c +++ b/nfq2/darkmagic.c @@ -178,8 +178,8 @@ void extract_endpoints(const struct ip *ip,const struct ip6_hdr *ip6hdr,const st } else { - memset(src,0,sizeof(*src)); - memset(dst,0,sizeof(*dst)); + if (src) memset(src,0,sizeof(*src)); + if (dst) memset(dst,0,sizeof(*dst)); } } diff --git a/nfq2/protocol.c b/nfq2/protocol.c index f7702f8..046fe71 100644 --- a/nfq2/protocol.c +++ b/nfq2/protocol.c @@ -413,7 +413,7 @@ ssize_t HttpPos(t_marker posmarker, int16_t pos, const uint8_t *data, size_t sz) if (*method=='\n' || *method=='\r') method++; if (*method=='\n' || *method=='\r') method++; // max length is PROPPATCH - for (p=method,i=0;i<9;i++) if (*p>='A' && *p<='Z') p++; + for (p=method,i=0; i<9 && *p>='A' && *p<='Z'; i++,p++); if (i<3 || *p!=' ') break; return CheckPos(sz,method-data+pos); case PM_HOST: