mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-11-02 18:23:15 +00:00
bgpd: Make sure hdr length is at a minimum of what is expected
Ensure that if the capability length specified is enough data. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
This commit is contained in:
parent
49efc80d34
commit
ff6db1027f
@ -2620,6 +2620,14 @@ static int bgp_capability_msg_parse(struct peer *peer, uint8_t *pnt,
|
||||
"%s CAPABILITY has action: %d, code: %u, length %u",
|
||||
peer->host, action, hdr->code, hdr->length);
|
||||
|
||||
if (hdr->length < sizeof(struct capability_mp_data)) {
|
||||
zlog_info(
|
||||
"%pBP Capability structure is not properly filled out, expected at least %zu bytes but header length specified is %d",
|
||||
peer, sizeof(struct capability_mp_data),
|
||||
hdr->length);
|
||||
return BGP_Stop;
|
||||
}
|
||||
|
||||
/* Capability length check. */
|
||||
if ((pnt + hdr->length + 3) > end) {
|
||||
zlog_info("%s Capability length error", peer->host);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user