From 8579fd2b3b40c212e636a1a0cdf762d6f5231505 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sun, 23 Jul 2017 19:56:30 +0200 Subject: [PATCH] ipp2p: fix PVSStudio reports V666 Consider inspecting fourth argument of the function 'HX_memmem'. It is possible that the value does not correspond with the length of a string which was passed with the third argument. --- 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 2b74a74..42c8314 100644 --- a/extensions/xt_ipp2p.c +++ b/extensions/xt_ipp2p.c @@ -511,7 +511,7 @@ search_bittorrent(const unsigned char *payload, const unsigned int plen) * but *must have* one (or more) of strings listed below (true for scrape and announce) */ if (memcmp(payload, "GET /", 5) == 0) { - if (HX_memmem(payload, plen, "info_hash=", 9) != NULL) + if (HX_memmem(payload, plen, "info_hash=", 10) != NULL) return IPP2P_BIT * 100 + 1; if (HX_memmem(payload, plen, "peer_id=", 8) != NULL) return IPP2P_BIT * 100 + 2;