aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gmhdr.c
diff options
context:
space:
mode:
authoretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2010-06-22 13:29:33 +0000
committeretxrab <etxrab@f5534014-38df-0310-8fa8-9805f1628bb7>2010-06-22 13:29:33 +0000
commitb7f52ad6b5ac7f3de4e585b8ea93679b5ce1fdcf (patch)
tree0c0b9ccc523cdef0d387f0e052810efb53037d7b /epan/dissectors/packet-gmhdr.c
parent0e45db676d766db2299b96874cac1bef89cf42ea (diff)
If the trailer is less than 4 bytes it's not a Gigamon hdr.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@33287 f5534014-38df-0310-8fa8-9805f1628bb7
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;