aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/collectd.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/protocols/collectd.c')
-rw-r--r--src/lib/protocols/collectd.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/lib/protocols/collectd.c b/src/lib/protocols/collectd.c
index 500b9a3f3..d4586d90a 100644
--- a/src/lib/protocols/collectd.c
+++ b/src/lib/protocols/collectd.c
@@ -159,7 +159,8 @@ static void ndpi_search_collectd(struct ndpi_detection_module_struct *ndpi_struc
* the collectd protocol.
*/
hostname_offset = block_offset;
- hostname_length = block_length;
+ if(block_length > 4)
+ hostname_length = block_length - 4; /* Ignore type and length fields */
} else if (block_type == COLELCTD_TYPE_ENCR_AES256) {
/*
* The encrypted data block is a special case.