diff options
author | Harald Welte <laforge@gnumonks.org> | 2018-08-07 17:00:08 +0200 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2018-08-09 07:01:15 +0000 |
commit | 297a6fe2f70d5356b88539f093aea32c06d20643 (patch) | |
tree | ac40425a9f2647778d006fd048b350bc775acd61 /epan/dissectors/packet-gsm_gsup.c | |
parent | 299306ab19c9b45d7306bbc57c934ae4f5c33b2c (diff) |
gsup: Fix dissecting wildcard APN names
In general, GPRS APN names are encoded like DNS strings. However,
there is one exception: The wildcard APN '*'. If we feed this
into the DNS decoder, it will throw an exception.
Let's explicitly check for '*' as a special case.
Change-Id: I2b346f8b067fa176b80613fdbcdada8c8a8eaa52
Related: https://osmocom.org/issues/3450
Reviewed-on: https://code.wireshark.org/review/29004
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan/dissectors/packet-gsm_gsup.c')
-rw-r--r-- | epan/dissectors/packet-gsm_gsup.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/epan/dissectors/packet-gsm_gsup.c b/epan/dissectors/packet-gsm_gsup.c index 10637ff4a2..6f5e0624f7 100644 --- a/epan/dissectors/packet-gsm_gsup.c +++ b/epan/dissectors/packet-gsm_gsup.c @@ -363,9 +363,16 @@ dissect_gsup_tlvs(tvbuff_t *tvb, int base_offs, int length, packet_info *pinfo, proto_item_append_text(gsup_ti, ", MSISDN: %s", str); break; case OSMO_GSUP_ACCESS_POINT_NAME_IE: - get_dns_name(tvb, offset, len, 0, &apn, &apn_len); - proto_tree_add_string(att_tree, hf_gsup_apn, tvb, offset, len, apn); - proto_item_append_text(ti, ", %s", apn); + if (len == 1) { + guint8 ch = tvb_get_guint8(tvb, offset); + proto_tree_add_item(att_tree, hf_gsup_ie_payload, tvb, offset, len, ENC_NA); + if (ch == '*') + proto_item_append_text(ti, ", '*' (Wildcard)"); + } else { + get_dns_name(tvb, offset, len, 0, &apn, &apn_len); + proto_tree_add_string(att_tree, hf_gsup_apn, tvb, offset, len, apn); + proto_item_append_text(ti, ", %s", apn); + } break; case OSMO_GSUP_PDP_CONTEXT_ID_IE: proto_tree_add_item(att_tree, hf_gsup_pdp_context_id, tvb, offset, len, ENC_NA); |