aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/zabbix.c
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2023-07-21 03:42:36 +0200
committerGitHub <noreply@github.com>2023-07-21 03:42:36 +0200
commit7a1509bf607cb86db520366335459e5fc317991b (patch)
tree30a58cb68b75929396935d5b3847fd4ef7b637b8 /src/lib/protocols/zabbix.c
parentc85f2fb0f44f734a34ac905d4e35fcf479f19901 (diff)
zabbix: improve detection (#2055)
Diffstat (limited to 'src/lib/protocols/zabbix.c')
-rw-r--r--src/lib/protocols/zabbix.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/protocols/zabbix.c b/src/lib/protocols/zabbix.c
index 29f5320be..528402927 100644
--- a/src/lib/protocols/zabbix.c
+++ b/src/lib/protocols/zabbix.c
@@ -37,13 +37,12 @@ static void ndpi_int_zabbix_add_connection(struct ndpi_detection_module_struct *
static void ndpi_search_zabbix(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow) {
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
- u_int8_t tomatch[] = { 'Z', 'B', 'X', 'D', 0x1 };
+ u_int8_t tomatch[] = { 'Z', 'B', 'X', 'D' };
NDPI_LOG_DBG(ndpi_struct, "search Zabbix\n");
- if(packet &&
- (packet->payload_packet_len > 4)
- && (memcmp(packet->payload, tomatch, 5) == 0))
+ if((packet->payload_packet_len >= 4)
+ && (memcmp(packet->payload, tomatch, 4) == 0))
ndpi_int_zabbix_add_connection(ndpi_struct, flow);
else
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);