Skip to content

Commit

Permalink
Merge pull request #16213 from opensourcerouting/fix/fqdn_capability_…
Browse files Browse the repository at this point in the history
…parsing_for_dynamic_capability

bgpd: Check if we have really enough data before doing memcpy for FQDN capability
  • Loading branch information
riw777 authored Jun 24, 2024
2 parents f047430 + b685ab5 commit ed5628f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bgpd/bgp_packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3438,7 +3438,7 @@ static void bgp_dynamic_capability_fqdn(uint8_t *pnt, int action,
}

len = *data;
if (data + len > end) {
if (data + len + 1 > end) {
zlog_err("%pBP: Received invalid FQDN capability length (host name) %d",
peer, hdr->length);
return;
Expand Down Expand Up @@ -3469,7 +3469,7 @@ static void bgp_dynamic_capability_fqdn(uint8_t *pnt, int action,

/* domainname */
len = *data;
if (data + len > end) {
if (data + len + 1 > end) {
zlog_err("%pBP: Received invalid FQDN capability length (domain name) %d",
peer, len);
return;
Expand Down

0 comments on commit ed5628f

Please sign in to comment.