aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-gsm_sim.c
diff options
context:
space:
mode:
authorPascal Quantin <pascal.quantin@gmail.com>2012-10-16 20:25:46 +0000
committerPascal Quantin <pascal.quantin@gmail.com>2012-10-16 20:25:46 +0000
commit16bb2a67bac44cc9f0bfc7c9b538452bcab98716 (patch)
tree98dd2ad3dc113ee86ed684f7af7199742f42dae3 /epan/dissectors/packet-gsm_sim.c
parent9f1fd13e9a678b361840a016f55d564e028f87bf (diff)
Fix dissection of BER-TLV and COMPREHENSION-TLV length and COMPREHENSION-TLV tag
svn path=/trunk/; revision=45595
Diffstat (limited to 'epan/dissectors/packet-gsm_sim.c')
-rw-r--r--epan/dissectors/packet-gsm_sim.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/epan/dissectors/packet-gsm_sim.c b/epan/dissectors/packet-gsm_sim.c
index 1cb4089716..59f6a2377b 100644
--- a/epan/dissectors/packet-gsm_sim.c
+++ b/epan/dissectors/packet-gsm_sim.c
@@ -1073,7 +1073,8 @@ dissect_bertlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
unsigned int pos = 0;
while (pos < tvb_length(tvb)) {
- guint8 tag, len;
+ guint8 tag;
+ guint32 len;
tvbuff_t *subtvb;
proto_tree_add_item(tree, hf_cat_ber_tag, tvb, pos, 1, ENC_BIG_ENDIAN);
@@ -1081,6 +1082,21 @@ dissect_bertlv(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
/* FIXME: properly follow BER coding rules */
tag = tvb_get_guint8(tvb, pos++);
len = tvb_get_guint8(tvb, pos++);
+ switch (len) {
+ case 0x81:
+ len = tvb_get_guint8(tvb, pos++);
+ break;
+ case 0x82:
+ len = tvb_get_ntohs(tvb, pos);
+ pos += 2;
+ break;
+ case 0x83:
+ len = tvb_get_ntoh24(tvb, pos);
+ pos += 3;
+ break;
+ default:
+ break;
+ }
subtvb = tvb_new_subset(tvb, pos, len, len);
switch (tag) {