aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/gnutella.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2024-07-12 14:22:25 +0200
committerGitHub <noreply@github.com>2024-07-12 14:22:25 +0200
commitc3ba65311e2cf4aba8b51cdb6800a5654ef1d060 (patch)
tree7f0aa30fc4ab1d0aaec75f08b84cb7f3705d29fa /src/lib/protocols/gnutella.c
parent456f0fd4279ae727831a80c506a343b8a9aedd90 (diff)
fuzzing: improve coverage (#2495)
Fix detection of WebDAV and Gnutella (over HTTP) Fix detection of z3950 Add two fuzzers to test `ndpi_memmem()` and `ndpi_strnstr()` Remove some dead code: * RTP: the same exact check is performed at the very beginning of the function * MQTT: use a better helper to exclude the protocol * Colletd: `ndpi_hostname_sni_set()` never fails Update pl7m code (fix a Use-of-uninitialized-value error)
Diffstat (limited to 'src/lib/protocols/gnutella.c')
-rw-r--r--src/lib/protocols/gnutella.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/protocols/gnutella.c b/src/lib/protocols/gnutella.c
index 94e1dc2ef..1e0f307eb 100644
--- a/src/lib/protocols/gnutella.c
+++ b/src/lib/protocols/gnutella.c
@@ -103,8 +103,10 @@ static void ndpi_search_gnutella(struct ndpi_detection_module_struct *ndpi_struc
|| (memcmp(packet->payload, "GET /uri-res/", 13) == 0))) {
c = 8;
while (c < (packet->payload_packet_len - 9)) {
- if (packet->payload[c] == '?')
+ if (packet->payload[c] == '?') {
+ c++;
break;
+ }
c++;
}