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>
This commit is contained in:
Martin Kaiser 2016-07-11 10:49:53 +02:00 committed by Anders Broman
parent deaac110db
commit 0002f25f29
1 changed files with 4 additions and 0 deletions

View File

@ -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;