aboutsummaryrefslogtreecommitdiffstats
path: root/asn1/tetra
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 /asn1/tetra
parentbb35c1c375274bdec6a9cf3eddb4fdfc7e65d7d2 (diff)
downloadwireshark-c891784de783cf23b8cf2957929af162480e0c73.tar.gz
wireshark-c891784de783cf23b8cf2957929af162480e0c73.tar.bz2
wireshark-c891784de783cf23b8cf2957929af162480e0c73.zip
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 'asn1/tetra')
-rw-r--r--asn1/tetra/packet-tetra-template.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/asn1/tetra/packet-tetra-template.c b/asn1/tetra/packet-tetra-template.c
index 0a33497101..4a8409119c 100644
--- a/asn1/tetra/packet-tetra-template.c
+++ b/asn1/tetra/packet-tetra-template.c
@@ -31,6 +31,7 @@
#include "config.h"
#include <glib.h>
+#include <epan/expert.h>
#include <epan/packet.h>
#include <epan/prefs.h>
#include <epan/oids.h>
@@ -340,6 +341,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++) {
@@ -396,6 +402,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};