From 4ac60d88d754da4058bb9dfdc7507be7243ba7fc Mon Sep 17 00:00:00 2001 From: Luca Deri Date: Thu, 11 Jul 2019 22:49:24 +0200 Subject: Improved whatsapp dissection --- src/lib/protocols/stun.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/lib/protocols/stun.c') diff --git a/src/lib/protocols/stun.c b/src/lib/protocols/stun.c index cf03ddaec..3e2e037f2 100644 --- a/src/lib/protocols/stun.c +++ b/src/lib/protocols/stun.c @@ -81,7 +81,9 @@ static ndpi_int_stun_t ndpi_int_check_stun(struct ndpi_detection_module_struct * msg_type, payload_length, flow->protos.stun_ssl.stun.num_binding_requests); */ - if(((payload[0] == 0x80) && ((msg_len+20) <= payload_length)) /* WhatsApp Voice */) { + if(((payload[0] == 0x80) + && (payload_length < 512) + && ((msg_len+20) <= payload_length)) /* WhatsApp Voice */) { *is_whatsapp = 1; return NDPI_IS_STUN; /* This is WhatsApp Voice */ } else if((payload[0] == 0x90) -- cgit v1.2.3