aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilippe Antoine <contact@catenacyber.fr>2020-03-12 14:26:08 +0100
committerPhilippe Antoine <contact@catenacyber.fr>2020-03-12 14:26:08 +0100
commit9d1340a8e7fc38aa39d0d81b4dfb596095804ae1 (patch)
treecbe9a41cf7f1768f26454a6583920bf85be87043
parent7a2bcd9c395f9fe554109e04add33e9e65564d82 (diff)
Fix buffer overread in yahoo
-rw-r--r--src/lib/protocols/yahoo.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lib/protocols/yahoo.c b/src/lib/protocols/yahoo.c
index ceb9d48b6..bd7f3ef66 100644
--- a/src/lib/protocols/yahoo.c
+++ b/src/lib/protocols/yahoo.c
@@ -62,6 +62,9 @@ __forceinline static
#endif
u_int8_t check_ymsg(const u_int8_t * payload, u_int16_t payload_packet_len)
{
+ if (payload_packet_len < sizeof(struct ndpi_yahoo_header)) {
+ return 0;
+ }
const struct ndpi_yahoo_header *yahoo = (struct ndpi_yahoo_header *) payload;
u_int16_t yahoo_len_parsed = 0;