openvpn: fix heap-overflow error

This commit is contained in:
Nardi Ivan
2020-03-27 11:09:53 +01:00
parent 3924257f32
commit 498571354d
+3
View File
@@ -120,6 +120,7 @@ void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct,
if(hmac_size > 0) { if(hmac_size > 0) {
alen = ovpn_payload[P_PACKET_ID_ARRAY_LEN_OFFSET(hmac_size)]; alen = ovpn_payload[P_PACKET_ID_ARRAY_LEN_OFFSET(hmac_size)];
if (alen > 0) {
session_remote = ovpn_payload + P_PACKET_ID_ARRAY_LEN_OFFSET(hmac_size) + 1 + alen * 4; session_remote = ovpn_payload + P_PACKET_ID_ARRAY_LEN_OFFSET(hmac_size) + 1 + alen * 4;
if(memcmp(flow->ovpn_session_id, session_remote, 8) == 0) { if(memcmp(flow->ovpn_session_id, session_remote, 8) == 0) {
@@ -137,6 +138,8 @@ void ndpi_search_openvpn(struct ndpi_detection_module_struct* ndpi_struct,
failed = 1; failed = 1;
} else } else
failed = 1; failed = 1;
} else
failed = 1;
flow->ovpn_counter++; flow->ovpn_counter++;