mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-05 19:33:11 +00:00
Revert "bgpd: fix insecure data write with ip addresses"
This reverts commit54222f9213
. (cherry picked from commit298d534013
)
This commit is contained in:
parent
83d4391f7b
commit
8ed3bbd19d
@ -577,8 +577,7 @@ static bool bgp_linkstate_nlri_value_display(char *buf, size_t size,
|
||||
break;
|
||||
case BGP_LS_TLV_IP_REACHABILITY_INFORMATION:
|
||||
mask_length = pnt_decode8(&pnt);
|
||||
if (nlri_type == BGP_LINKSTATE_PREFIX4 &&
|
||||
((length - sizeof(mask_length)) <= sizeof(ipv4.s_addr))) {
|
||||
if (nlri_type == BGP_LINKSTATE_PREFIX4) {
|
||||
memcpy(&ipv4.s_addr, pnt, length - sizeof(mask_length));
|
||||
if (json)
|
||||
json_object_string_addf(json, "ipReachability",
|
||||
@ -588,8 +587,7 @@ static bool bgp_linkstate_nlri_value_display(char *buf, size_t size,
|
||||
snprintfrr(buf, size, "%sIPv4:%pI4/%u",
|
||||
first ? "" : " ", &ipv4,
|
||||
mask_length);
|
||||
} else if (nlri_type == BGP_LINKSTATE_PREFIX6 &&
|
||||
((length - sizeof(mask_length)) <= sizeof(ipv6))) {
|
||||
} else if (nlri_type == BGP_LINKSTATE_PREFIX6) {
|
||||
memcpy(&ipv6, pnt, length - sizeof(mask_length));
|
||||
if (json)
|
||||
json_object_string_addf(json, "ipReachability",
|
||||
|
Loading…
Reference in New Issue
Block a user