Merge pull request #16213 from opensourcerouting/fix/fqdn_capability_parsing_for_dynamic_capability

bgpd: Check if we have really enough data before doing memcpy for FQDN capability
This commit is contained in:
Russ White 2024-06-24 16:38:58 -04:00 committed by GitHub
commit ed5628fef1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;
@ -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;