Skip to content

Commit

Permalink
collectd: fix extraction of hostname (#2301)
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanNardi authored Feb 3, 2024
1 parent ede25cc commit 9af2b9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/protocols/collectd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 9af2b9d

Please sign in to comment.