mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-06 12:45:13 +02:00
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.
This commit is contained in:
@@ -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)
|
* but *must have* one (or more) of strings listed below (true for scrape and announce)
|
||||||
*/
|
*/
|
||||||
if (memcmp(payload, "GET /", 5) == 0) {
|
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;
|
return IPP2P_BIT * 100 + 1;
|
||||||
if (HX_memmem(payload, plen, "peer_id=", 8) != NULL)
|
if (HX_memmem(payload, plen, "peer_id=", 8) != NULL)
|
||||||
return IPP2P_BIT * 100 + 2;
|
return IPP2P_BIT * 100 + 2;
|
||||||
|
Reference in New Issue
Block a user