diff options
author | theirix <theirix@gmail.com> | 2016-04-12 22:14:13 +0300 |
---|---|---|
committer | theirix <theirix@gmail.com> | 2016-04-12 22:14:13 +0300 |
commit | c22d3d3cae8fc6d5fcf1b7320a7602426a9b9ca2 (patch) | |
tree | adebbf469efc03bba8a8d955b5116b35ae50ef3e /src/lib/protocols/gnutella.c | |
parent | fb3fc0c6de201a2ab34b6f7ce4d5dfc2c54c3b5e (diff) |
Fixed more buffer overflows with small packets
Diffstat (limited to 'src/lib/protocols/gnutella.c')
-rw-r--r-- | src/lib/protocols/gnutella.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/gnutella.c b/src/lib/protocols/gnutella.c index 09d4d0852..e45096391 100644 --- a/src/lib/protocols/gnutella.c +++ b/src/lib/protocols/gnutella.c @@ -294,7 +294,7 @@ void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struct, stru return; } - if (memcmp(packet->payload, "GND", 3) == 0) { + if (packet->payload_packet_len >= 3 && memcmp(packet->payload, "GND", 3) == 0) { if ((packet->payload_packet_len == 8 && (memcmp(&packet->payload[6], "\x01\x00", 2) == 0)) || (packet->payload_packet_len == 11 && (memcmp(&packet->payload[6], "\x01\x01\x08\x50\x49", 5) == 0)) || (packet->payload_packet_len == 17 |