From 627917faff4889f763bf8e6570f62d66656047bd Mon Sep 17 00:00:00 2001
From: Michael Mann <mmann78@netscape.net>
Date: Wed, 28 Aug 2019 22:27:58 -0400
Subject: [PATCH] Gryphon: Prevent endless loop

Bug: 16020
Change-Id: I59c24d3bdb3f3a85f6e498683594ee12db9642a8
Reviewed-on: https://code.wireshark.org/review/34392
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
---
 plugins/epan/gryphon/packet-gryphon.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/plugins/epan/gryphon/packet-gryphon.c b/plugins/epan/gryphon/packet-gryphon.c
index 82d14eaca4..334c47611a 100644
--- a/plugins/epan/gryphon/packet-gryphon.c
+++ b/plugins/epan/gryphon/packet-gryphon.c
@@ -1193,7 +1193,11 @@ dissect_gryphon_message_with_offset(tvbuff_t *tvb, int offset, packet_info *pinf
          * Unknown message type.
          */
         proto_tree_add_item(gryphon_tree, hf_gryphon_data, tvb, offset, msglen, ENC_NA);
-        offset += msglen;
+        if (msglen != 0) {
+            offset += msglen;
+        } else {
+            offset = tvb_reported_length_remaining(tvb, offset);
+        }
         return offset;
     }
 
