aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMarius Paliga <marius.paliga@gmail.com>2017-10-27 13:21:50 +0200
committerAnders Broman <a.broman58@gmail.com>2017-10-27 13:51:18 +0000
commit545f20022419affa1ad71824b434141551359cc3 (patch)
treed873bbdbca6d935cbfe078f7fe5342e271686843 /epan
parent0a033cdc653b0ce4ec921312b4a34c7a028039f8 (diff)
PFCP: Dissect Node ID: Fix length of FQDN Node Id Type
Octet 5 (Spare Node/ID Type) is included in the IE length and FQDN uses just remainding length Change-Id: I9c6e1de850bda0af315cbf801e757af6b25ed33e Reviewed-on: https://code.wireshark.org/review/24101 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-pfcp.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/epan/dissectors/packet-pfcp.c b/epan/dissectors/packet-pfcp.c
index efa472c2f5..8b7b3033cc 100644
--- a/epan/dissectors/packet-pfcp.c
+++ b/epan/dissectors/packet-pfcp.c
@@ -1670,13 +1670,13 @@ dissect_pfcp_node_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_
/* FQDN, the Node ID value encoding shall be identical to the encoding of a FQDN
* within a DNS message of section 3.1 of IETF RFC 1035 [27] but excluding the trailing zero byte.
*/
- if (length > 0) {
+ if (length > 1) {
name_len = tvb_get_guint8(tvb, offset);
if (name_len < 0x20) {
- fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 1, ENC_ASCII);
+ fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 2, ENC_ASCII);
for (;;) {
- if (name_len >= length - 1)
+ if (name_len >= length - 2)
break;
tmp = name_len;
name_len = name_len + fqdn[tmp] + 1;
@@ -1684,11 +1684,11 @@ dissect_pfcp_node_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_
}
}
else {
- fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII);
+ fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length -1, ENC_ASCII);
}
- proto_tree_add_string(tree, hf_pfcp_node_id_fqdn, tvb, offset, length, fqdn);
+ proto_tree_add_string(tree, hf_pfcp_node_id_fqdn, tvb, offset, length - 1, fqdn);
proto_item_append_text(item, "%s", fqdn);
- offset += length;
+ offset += length - 1;
}
break;
default: