aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bgp.c
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2017-07-07 13:25:07 +0200
committerMichael Mann <mmann78@netscape.net>2017-07-08 00:08:22 +0000
commitc4c4c44a21cd45334ecd07494dba84c6ba64eda6 (patch)
tree5be7f9b0547e44a15e3480a9468ce2be9e851acb /epan/dissectors/packet-bgp.c
parent9c29f738725b1b0c9b1db663351e4faf56932b11 (diff)
BGP: fix incorrect decoding COMMUNITIES whose length is larger than 255
Issue reported by Kura Bug: 13872 Change-Id: I054839a9e141fa4a882114b150842366c090d012 Reviewed-on: https://code.wireshark.org/review/22537 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-bgp.c')
-rw-r--r--epan/dissectors/packet-bgp.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/epan/dissectors/packet-bgp.c b/epan/dissectors/packet-bgp.c
index 6a63ca1e63..9506d0cdc9 100644
--- a/epan/dissectors/packet-bgp.c
+++ b/epan/dissectors/packet-bgp.c
@@ -7093,25 +7093,25 @@ dissect_bgp_path_attr(proto_tree *subtree, tvbuff_t *tvb, guint16 path_attr_len,
if ((community & 0xFFFF0000) == FOURHEX0 ||
(community & 0xFFFF0000) == FOURHEXF) {
proto_tree_add_item(communities_tree, hf_bgp_update_path_attribute_community_well_known,
- tvb, q - 3 + aoff, 4, ENC_BIG_ENDIAN);
+ tvb, q, 4, ENC_BIG_ENDIAN);
proto_item_append_text(ti_pa, "%s ", val_to_str_const(community, community_vals, "Reserved"));
proto_item_append_text(ti_communities, "%s ", val_to_str_const(community, community_vals, "Reserved"));
}
else {
ti_community = proto_tree_add_item(communities_tree, hf_bgp_update_path_attribute_community, tvb,
- q - 3 + aoff, 4, ENC_NA);
+ q, 4, ENC_NA);
community_tree = proto_item_add_subtree(ti_community,
ett_bgp_community);
proto_tree_add_item(community_tree, hf_bgp_update_path_attribute_community_as,
- tvb, q - 3 + aoff, 2, ENC_BIG_ENDIAN);
+ tvb, q, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(community_tree, hf_bgp_update_path_attribute_community_value,
- tvb, q - 1 + aoff, 2, ENC_BIG_ENDIAN);
- proto_item_append_text(ti_pa, "%u:%u ",tvb_get_ntohs(tvb, q - 3 + aoff),
- tvb_get_ntohs(tvb, q -1 + aoff));
- proto_item_append_text(ti_communities, "%u:%u ",tvb_get_ntohs(tvb, q - 3 + aoff),
- tvb_get_ntohs(tvb, q -1 + aoff));
- proto_item_append_text(ti_community, ": %u:%u ",tvb_get_ntohs(tvb, q - 3 + aoff),
- tvb_get_ntohs(tvb, q -1 + aoff));
+ tvb, q+2, 2, ENC_BIG_ENDIAN);
+ proto_item_append_text(ti_pa, "%u:%u ",tvb_get_ntohs(tvb, q),
+ tvb_get_ntohs(tvb, q+2));
+ proto_item_append_text(ti_communities, "%u:%u ",tvb_get_ntohs(tvb, q),
+ tvb_get_ntohs(tvb, q+2));
+ proto_item_append_text(ti_community, ": %u:%u ",tvb_get_ntohs(tvb, q),
+ tvb_get_ntohs(tvb, q+2));
}
q += 4;