diff options
Diffstat (limited to 'epan/dissectors/packet-q931.c')
-rw-r--r-- | epan/dissectors/packet-q931.c | 11 |
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? */ |