mirror of
git://git.code.sf.net/p/xtables-addons/xtables-addons
synced 2025-09-08 05:34:58 +02:00
ipp2p: add boundary check in search_all_kazaa
To avoid underflow on "end - 18", we must check for plen >= 18.
This commit is contained in:
@@ -623,6 +623,10 @@ search_all_kazaa(const unsigned char *payload, const unsigned int plen)
|
|||||||
if (memcmp(payload, "GET /", 5) != 0)
|
if (memcmp(payload, "GET /", 5) != 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
if (plen < 18)
|
||||||
|
/* The next tests would not succeed anyhow. */
|
||||||
|
return 0;
|
||||||
|
|
||||||
end = plen - 18;
|
end = plen - 18;
|
||||||
rem = plen - 5;
|
rem = plen - 5;
|
||||||
for (c = 5; c < end; ++c, --rem) {
|
for (c = 5; c < end; ++c, --rem) {
|
||||||
|
Reference in New Issue
Block a user