aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2022-01-15 20:53:36 +0100
committerGitHub <noreply@github.com>2022-01-15 20:53:36 +0100
commite46b508a36415b0fc76dbaaf6e65a5d9e425598f (patch)
tree72a98785af2f5db8454c76ce98eb831490d07659
parenteb5d7b07afae0d1dd8f5b079835d8f1ec66dc160 (diff)
Kerberos: fix use-of-uninitialized-value error (#1409)
Detected by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=43677
-rw-r--r--src/lib/protocols/kerberos.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/protocols/kerberos.c b/src/lib/protocols/kerberos.c
index c89923fc6..98d919391 100644
--- a/src/lib/protocols/kerberos.c
+++ b/src/lib/protocols/kerberos.c
@@ -260,7 +260,7 @@ void ndpi_search_kerberos(struct ndpi_detection_module_struct *ndpi_struct,
printf("[AS-REQ][s/dport: %u/%u][Kerberos Cname][len: %u][%s]\n", sport, dport, cname_len, cname_str);
#endif
- if(((strcmp(cname_str, "host") == 0) || (strcmp(cname_str, "ldap") == 0)) && (packet->payload[name_offset+1+cname_len] == 0x1b)) {
+ if(((strcmp(cname_str, "host") == 0) || (strcmp(cname_str, "ldap") == 0)) && (packet->payload[name_offset+1+cname_len] == 0x1b) && num_cname == 1) {
name_offset += cname_len + 2;
if (name_offset < packet->payload_packet_len)
cname_len = packet->payload[name_offset];