Fixed missing length check in fbzero.
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
This commit is contained in:
@@ -85,9 +85,12 @@ void ndpi_search_fbzero(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
char *value = (char*)&packet->payload[data_offset + data_prev_offset];
|
||||
u_int tag_len = t->tag_offset_len-data_prev_offset, max_len;
|
||||
ndpi_protocol_match_result ret_match;
|
||||
|
||||
|
||||
max_len = ndpi_min(tag_len, sizeof(flow->host_server_name)-1);
|
||||
|
||||
if (data_offset + data_prev_offset + max_len >= packet->payload_packet_len) {
|
||||
return;
|
||||
}
|
||||
strncpy((char*)flow->host_server_name, value, max_len);
|
||||
flow->host_server_name[max_len] = '\0';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user