aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gmhdr.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2010-06-22 13:29:33 +0000
committerAnders Broman <anders.broman@ericsson.com>2010-06-22 13:29:33 +0000
commit017e4d0dc06dc5725518070c9110b53d4e98f063 (patch)
tree0c0b9ccc523cdef0d387f0e052810efb53037d7b /epan/dissectors/packet-gmhdr.c
parentc7ed9aa2b82d9a36ebb0fbf472d8ff3c8397d4e2 (diff)
If the trailer is less than 4 bytes it's not a Gigamon hdr.
svn path=/trunk/; revision=33287
Diffstat (limited to 'epan/dissectors/packet-gmhdr.c')
-rw-r--r--epan/dissectors/packet-gmhdr.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/epan/dissectors/packet-gmhdr.c b/epan/dissectors/packet-gmhdr.c
index 04fa14ddc9..18417878f5 100644
--- a/epan/dissectors/packet-gmhdr.c
+++ b/epan/dissectors/packet-gmhdr.c
@@ -199,6 +199,11 @@ dissect_gmtrailer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree)
guint offset;
guint16 cksum, comp_cksum;
+ offset = tvb_reported_length(tvb);
+ if (offset<4){
+ return 0;
+ }
+
/* See if this packet has a Gigamon trailer, if yes, then decode it */
if (tvb_get_ntohs(tvb, -4) != ETHERTYPE_GIGAMON) {
return 0;