aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tetra.c
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-06-05 16:38:20 +0000
committerGerald Combs <gerald@wireshark.org>2013-06-05 16:38:20 +0000
commitc891784de783cf23b8cf2957929af162480e0c73 (patch)
tree1e684da616c42d03025c10f89717682d5f88ea48 /epan/dissectors/packet-tetra.c
parentbb35c1c375274bdec6a9cf3eddb4fdfc7e65d7d2 (diff)
Quick fix for bug 8768. For now assume that only three logical channels
are valid. If we run into more add expert item and cap the channel count. svn path=/trunk/; revision=49787
Diffstat (limited to 'epan/dissectors/packet-tetra.c')
-rw-r--r--epan/dissectors/packet-tetra.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/epan/dissectors/packet-tetra.c b/epan/dissectors/packet-tetra.c
index 1e77ff4c44..bfd3572aae 100644
--- a/epan/dissectors/packet-tetra.c
+++ b/epan/dissectors/packet-tetra.c
@@ -39,6 +39,7 @@
#include "config.h"
#include <glib.h>
+#include <epan/expert.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/oids.h>
@@ -686,7 +687,7 @@ static int hf_tetra_proprietary_element_owner_extension = -1; /* BIT_STRING */
static int hf_tetra_simplex_duplex_selection_06 = -1; /* T_simplex_duplex_selection_05 */
/*--- End of included file: packet-tetra-hf.c ---*/
-#line 85 "../../asn1/tetra/packet-tetra-template.c"
+#line 86 "../../asn1/tetra/packet-tetra-template.c"
/* Initialize the subtree pointers */
/* These are the ids of the subtrees that we may be creating */
@@ -971,7 +972,7 @@ static gint ett_tetra_Type2 = -1;
static gint ett_tetra_Modify_type = -1;
/*--- End of included file: packet-tetra-ett.c ---*/
-#line 95 "../../asn1/tetra/packet-tetra-template.c"
+#line 96 "../../asn1/tetra/packet-tetra-template.c"
/*--- Included file: packet-tetra-fn.c ---*/
@@ -8773,7 +8774,7 @@ static void dissect_MAC_ACCESS_DEFINE_PDU(tvbuff_t *tvb _U_, packet_info *pinfo
/*--- End of included file: packet-tetra-fn.c ---*/
-#line 97 "../../asn1/tetra/packet-tetra-template.c"
+#line 98 "../../asn1/tetra/packet-tetra-template.c"
static const value_string channeltypenames[] = {
{ 0, "Reserved" },
@@ -9020,6 +9021,11 @@ static void dissect_tetra_UNITDATA_IND(tvbuff_t *tvb, packet_info *pinfo, proto_
channels = rxreg & 0x3;
tetra_sub_item = proto_tree_add_uint( tetra_tree, hf_tetra_channels, tvb, offset, 4, channels );
tetra_header_tree = proto_item_add_subtree(tetra_sub_item, ett_tetra);
+ if (channels > 3) {
+ expert_add_info_format(pinfo, tetra_sub_item, PI_MALFORMED, PI_WARN,
+ "Channel count incorrect, must be <= 3");
+ channels = 3;
+ }
pdu_offset = offset + 4;
for(i = 0; i < channels; i++) {
@@ -9076,6 +9082,12 @@ void dissect_tetra_UNITDATA_REQ(tvbuff_t *tvb, packet_info *pinfo, proto_tree *t
if(channels == 2)
txreg >>= 4;
+ if (channels > 3) {
+ expert_add_info_format(pinfo, tetra_sub_item, PI_MALFORMED, PI_WARN,
+ "Channel count incorrect, must be <= 3");
+ channels = 3;
+ }
+
pdu_offset = offset + 4;
for(i = 0; i < channels; i++) {
gint hf_channel[] = {hf_tetra_channel1, hf_tetra_channel2, hf_tetra_channel3};
@@ -11662,7 +11674,7 @@ void proto_register_tetra (void)
"T_simplex_duplex_selection_05", HFILL }},
/*--- End of included file: packet-tetra-hfarr.c ---*/
-#line 613 "../../asn1/tetra/packet-tetra-template.c"
+#line 625 "../../asn1/tetra/packet-tetra-template.c"
};
/* List of subtrees */
@@ -11947,7 +11959,7 @@ void proto_register_tetra (void)
&ett_tetra_Modify_type,
/*--- End of included file: packet-tetra-ettarr.c ---*/
-#line 623 "../../asn1/tetra/packet-tetra-template.c"
+#line 635 "../../asn1/tetra/packet-tetra-template.c"
};
/* execute protocol initialization only once */