Thrift: fix heap-buffer-overflow (#2024)
This commit is contained in:
@@ -120,7 +120,7 @@ static void thrift_set_method(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
ndpi_set_risk(ndpi_struct, flow, NDPI_INVALID_CHARACTERS, "Invalid method name");
|
||||
flow->protos.thrift.method[0] = '\0';
|
||||
} else {
|
||||
strncpy(flow->protos.thrift.method, method, method_length);
|
||||
strncpy(flow->protos.thrift.method, method, ndpi_min(sizeof(flow->protos.thrift.method), method_length));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user