From 0002f25f29dba076eef2bac63193949f7289f754 Mon Sep 17 00:00:00 2001 From: Martin Kaiser Date: Mon, 11 Jul 2016 10:49:53 +0200 Subject: hdcp2: don't throw an exception during heuristic check Change-Id: I24895950464e1845c468f9fa9b6e5aa3ab8c75de Reviewed-on: https://code.wireshark.org/review/16378 Reviewed-by: Jaap Keuter Petri-Dish: Jaap Keuter Reviewed-by: Anders Broman --- epan/dissectors/packet-hdcp2.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/epan/dissectors/packet-hdcp2.c b/epan/dissectors/packet-hdcp2.c index cc9ff70785..2ad0b3b1ac 100644 --- a/epan/dissectors/packet-hdcp2.c +++ b/epan/dissectors/packet-hdcp2.c @@ -131,6 +131,10 @@ dissect_hdcp2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U ptvcursor_t *cursor; /* do the plausibility checks before setting up anything */ + + /* make sure that tvb_get_guint8() won't throw an exception */ + if (tvb_captured_length(tvb) < 1) + return 0; msg_id = tvb_get_guint8(tvb, 0); if (msg_id > ID_MAX) return 0; -- cgit v1.2.3