mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-11-01 12:47:16 +00:00
bgpd: fix unaligned access to addpath id
uint8_t * cannot be cast to uint32_t * unless the pointed-to address is aligned according to uint32_t's alignment rules. And it usually is not. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
This commit is contained in:
parent
5c3be0814f
commit
454d85cf62
@ -4515,7 +4515,8 @@ int bgp_nlri_parse_ip(struct peer *peer, struct attr *attr,
|
||||
if (pnt + BGP_ADDPATH_ID_LEN >= lim)
|
||||
return BGP_NLRI_PARSE_ERROR_PACKET_OVERFLOW;
|
||||
|
||||
addpath_id = ntohl(*((uint32_t *)pnt));
|
||||
memcpy(&addpath_id, pnt, 4);
|
||||
addpath_id = ntohl(addpath_id);
|
||||
pnt += BGP_ADDPATH_ID_LEN;
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user