Thrift: fix heap-buffer-overflow (#2024)

This commit is contained in:
Ivan Nardi
2023-06-26 11:41:01 +02:00
committed by GitHub
parent 7ef80f6b78
commit 3a1600ff26
+1 -1
View File
@@ -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));
}
}