aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols
diff options
context:
space:
mode:
authorIvan Nardi <12729895+IvanNardi@users.noreply.github.com>2024-02-03 04:11:58 +0100
committerGitHub <noreply@github.com>2024-02-03 04:11:58 +0100
commit9af2b9d815632fc4d28fcd4306f5599e15b237ef (patch)
tree3751666e52de49c2efba2df2e5135c536769aa40 /src/lib/protocols
parentede25cc2b33d809a92dab6a64ba82ab9b4818ae1 (diff)
collectd: fix extraction of hostname (#2301)
Diffstat (limited to 'src/lib/protocols')
-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.