aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMartin Kaiser <wireshark@kaiser.cx>2016-07-11 10:49:53 +0200
committerAnders Broman <a.broman58@gmail.com>2016-07-11 09:56:55 +0000
commit0002f25f29dba076eef2bac63193949f7289f754 (patch)
treeb4ca5ecea34b7437073105c4676fcf1ab108dbcb /epan
parentdeaac110db74ad6de7b3d7a6416d1b0df7c51fe1 (diff)
hdcp2: don't throw an exception during heuristic check
Change-Id: I24895950464e1845c468f9fa9b6e5aa3ab8c75de Reviewed-on: https://code.wireshark.org/review/16378 Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-hdcp2.c4
1 files changed, 4 insertions, 0 deletions
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;