aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-q931.c
diff options
context:
space:
mode:
authorAnders Broman <anders.broman@ericsson.com>2005-12-01 06:20:17 +0000
committerAnders Broman <anders.broman@ericsson.com>2005-12-01 06:20:17 +0000
commit20f04faf968a9b1e0d2d2423ab0e7c5892de0e13 (patch)
tree08f6b54fa90baa6a8ed134923470104db5ba85eb /epan/dissectors/packet-q931.c
parent72b18dfd817f9ff1636b008cbbcdca1a67a26975 (diff)
From Jaap Keuter:
Q.931 fails to pass long message to H.225 svn path=/trunk/; revision=16631
Diffstat (limited to 'epan/dissectors/packet-q931.c')
-rw-r--r--epan/dissectors/packet-q931.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/epan/dissectors/packet-q931.c b/epan/dissectors/packet-q931.c
index 3e34a32719..dacb59e4e8 100644
--- a/epan/dissectors/packet-q931.c
+++ b/epan/dissectors/packet-q931.c
@@ -45,6 +45,10 @@
#include <epan/lapd_sapi.h>
#include "packet-tpkt.h"
+#ifndef min
+#define min(a,b) (((a)<(b))?(a):(b))
+#endif
+
/* Q.931 references:
*
* http://www.acacia-net.com/Clarinet/Protocol/q9313svn.htm
@@ -2625,6 +2629,13 @@ dissect_q931_IEs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *root_tree,
if (info_element_len > 1) {
/*
+ * If we don't desegment limit the length
+ * to the actual size in the frame
+ */
+ if (!pinfo->can_desegment) {
+ info_element_len = min(info_element_len, tvb_length_remaining(tvb, offset + 4));
+ }
+ /*
* Do we have a handle for the H.225
* dissector?
*/