From 97a6b9dd5be2ffe18f0a9471c8ff90aca0885eab Mon Sep 17 00:00:00 2001 From: bol-van Date: Wed, 4 Feb 2026 22:06:23 +0300 Subject: [PATCH] nfqws2: AI inspired fixes --- nfq2/darkmagic.c | 4 ++-- nfq2/protocol.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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: