Skip to content

Commit

Permalink
BGP: Optlen must be a 16 bit integer now
Browse files Browse the repository at this point in the history
The extended option length in RFC 9072 must be stored in
a 16 bit integer to avoid stepping the offset by the wrong
value due to overflow.

Fixup commit a9a62ff
  • Loading branch information
johnthacker committed Sep 22, 2023
1 parent cf5a2bb commit 80a4dc5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions epan/dissectors/packet-bgp.c
Expand Up @@ -8441,7 +8441,7 @@ dissect_bgp_capability_item(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
static void
dissect_bgp_open(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo)
{
guint8 optlen; /* Option Length */
uint16_t optlen; /* Option Length */
int ptype; /* parameter type */
int plen; /* parameter length */
int cend; /* capabilities end */
Expand Down Expand Up @@ -11439,10 +11439,10 @@ proto_register_bgp(void)
NULL, 0x0, "The total length of the Optional Parameters field in octets", HFILL }},
{ &hf_bgp_open_opt_extension,
{ "Optional Parameter Extension", "bgp.open.opt.extension", FT_NONE, BASE_NONE,
NULL, 0x0, "Optional Parameters Extension dedetected", HFILL }},
NULL, 0x0, "Optional Parameters Extension detected", HFILL }},
{ &hf_bgp_open_opt_extension_mark,
{ "Extension Mark", "bgp.open.opt.extension.mark", FT_UINT8, BASE_DEC,
NULL, 0x0, "Optional Parameters Extension dedetected", HFILL }},
NULL, 0x0, "Optional Parameters Extension detected", HFILL }},
{ &hf_bgp_open_opt_extension_len,
{ "Extended Length", "bgp.open.opt.extension_len", FT_UINT16, BASE_DEC,
NULL, 0x0, "The total extended length of the Optional Parameters field in octets", HFILL }},
Expand Down

0 comments on commit 80a4dc5

Please sign in to comment.