Fix incorrect "<iq from=\"' parsing

This PR fixes a wrong size arg passed to memcmp when checking for "<iq from=\"" and "<iq from \'" strings.
This commit is contained in:
Disconnect3d
2020-04-13 16:35:03 +02:00
committed by GitHub
parent d665df64e2
commit fa15e170b4
+1 -1
View File
@@ -135,7 +135,7 @@ void ndpi_search_jabber_tcp(struct ndpi_detection_module_struct *ndpi_struct, st
return;
}
/* need message to or type for file-transfer */
if (memcmp(packet->payload, "<iq from=\"", 8) == 0 || memcmp(packet->payload, "<iq from=\'", 8) == 0) {
if (memcmp(packet->payload, "<iq from=\"", 10) == 0 || memcmp(packet->payload, "<iq from=\'", 10) == 0) {
NDPI_LOG_DBG2(ndpi_struct, "JABBER <iq from=\"\n");
lastlen = packet->payload_packet_len - 11;
for (x = 10; x < lastlen; x++) {