aboutsummaryrefslogtreecommitdiffstats
path: root/packet-giop.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2000-11-09 09:15:40 +0000
committerGuy Harris <guy@alum.mit.edu>2000-11-09 09:15:40 +0000
commitf832ad5f8b95a04c107ca793171a351b5991332d (patch)
tree4fd995a869af99fcefe673f9868fe0d5deab2f62 /packet-giop.c
parent718fe2b54902ccf314798c8a852b669e977284b8 (diff)
If the packet doesn't have at least GIOP_HEADER_SIZE worth of data
available, don't try to create a tvbuff for the GIOP header - that'll throw an exception before we even get to look at the packet to see if it's a GIOP packet. Instead, just return FALSE, as we don't have enough data to determine whether it's a GIOP packet or not. svn path=/trunk/; revision=2587
Diffstat (limited to 'packet-giop.c')
-rw-r--r--packet-giop.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/packet-giop.c b/packet-giop.c
index dcd8c13e92..d9d9876c49 100644
--- a/packet-giop.c
+++ b/packet-giop.c
@@ -4,7 +4,7 @@
* Laurent Deniel <deniel@worldnet.fr>
* Craig Rodrigues <rodrigc@mediaone.net>
*
- * $Id: packet-giop.c,v 1.20 2000/11/08 22:18:04 guy Exp $
+ * $Id: packet-giop.c,v 1.21 2000/11/09 09:15:40 guy Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@@ -1077,6 +1077,13 @@ dissect_giop (tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
/*define END_OF_GIOP_MESSAGE (offset - first_offset - GIOP_HEADER_SIZE) */
+ if (tvb_length_remaining(tvb, 0) < GIOP_HEADER_SIZE)
+ {
+ /* Not enough data captured to hold the GIOP header; don't try
+ to interpret it as GIOP. */
+ return FALSE;
+ }
+
giop_header_tvb = tvb_new_subset (tvb, 0, GIOP_HEADER_SIZE, -1);
payload_tvb = tvb_new_subset (tvb, GIOP_HEADER_SIZE, -1, -1);