From 545236879f3b1f9d056355c1f6d7066e9a9d99be Mon Sep 17 00:00:00 2001 From: Gerald Combs Date: Fri, 7 Jul 2006 22:39:23 +0000 Subject: Fix more bugs reported by Ilja van Sprundel. packet-pktc.c: Catch an underflow. packet-ospf.c: Don't burn CPU cycles unnecessarily. packet-rpc.c: Catch an overflow. packet-mq.c: Check a header size. Fix up whitespace. svn path=/trunk/; revision=18685 --- epan/dissectors/packet-mq.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'epan/dissectors/packet-mq.c') diff --git a/epan/dissectors/packet-mq.c b/epan/dissectors/packet-mq.c index 87f996e937..9529b4917c 100644 --- a/epan/dissectors/packet-mq.c +++ b/epan/dissectors/packet-mq.c @@ -2204,7 +2204,10 @@ dissect_mq_pdu(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* Dissect the generic part of the other pre-defined headers */ /* We assume that only one such header is present */ gint iSizeHeader = 0; - iSizeHeader = tvb_get_guint32_endian(tvb, offset + 8, bLittleEndian); + iSizeHeader = (gint) tvb_get_guint32_endian(tvb, offset + 8, bLittleEndian); + /* XXX - 32 is inferred from the code below. What's the + * correct minimum? */ + DISSECTOR_ASSERT(iSizeHeader > 32); if (tvb_length_remaining(tvb, offset) >= iSizeHeader) { -- cgit v1.2.3