mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-02 22:09:48 +00:00
Merge pull request #11203 from donaldsharp/coverity_bgp_memcpy
bgpd: Fix coverity SA issue with copying over prefix data
This commit is contained in:
commit
14d5ebf652
@ -5694,12 +5694,12 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
|
||||
}
|
||||
|
||||
/* Defensive coding, double-check the psize fits in a struct
|
||||
* prefix */
|
||||
if (psize > (ssize_t)sizeof(p.u)) {
|
||||
* prefix for the v4 and v6 afi's and unicast/multicast */
|
||||
if (psize > (ssize_t)sizeof(p.u.val)) {
|
||||
flog_err(
|
||||
EC_BGP_UPDATE_RCV,
|
||||
"%s [Error] Update packet error (prefix length %d too large for prefix storage %zu)",
|
||||
peer->host, p.prefixlen, sizeof(p.u));
|
||||
peer->host, p.prefixlen, sizeof(p.u.val));
|
||||
return BGP_NLRI_PARSE_ERROR_PACKET_LENGTH;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user