From 38a85247cf5ee58b08ff4d40712ff5f1fc4b1ebc Mon Sep 17 00:00:00 2001 From: Jeremy Sowden Date: Mon, 5 Jun 2023 21:17:28 +0900 Subject: [PATCH] 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 --- extensions/xt_ipp2p.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.47.3