From: Jeremy Sowden Date: Mon, 5 Jun 2023 12:17:28 +0000 (+0900) Subject: xt_ipp2p: fix an off-by-one error X-Git-Tag: v3.25~18 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=38a85247cf5ee58b08ff4d40712ff5f1fc4b1ebc;p=thirdparty%2Fxtables-addons.git xt_ipp2p: fix an off-by-one error When checking for waste, we check that the packet is at least eight bytes long and then examine the first nine bytes. Fix the length check. Signed-off-by: Jeremy Sowden --- diff --git a/extensions/xt_ipp2p.c b/extensions/xt_ipp2p.c index e311926..d11594b 100644 --- a/extensions/xt_ipp2p.c +++ b/extensions/xt_ipp2p.c @@ -793,7 +793,7 @@ search_xdcc(const unsigned char *payload, const unsigned int plen) static unsigned int search_waste(const unsigned char *payload, const unsigned int plen) { - if (plen >= 8 && memcmp(payload, "GET.sha1:", 9) == 0) + if (plen >= 9 && memcmp(payload, "GET.sha1:", 9) == 0) return IPP2P_WASTE * 100 + 0; return 0;