mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-06-07 09:11:25 +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;
|
break;
|
||||||
case BGP_LS_TLV_IP_REACHABILITY_INFORMATION:
|
case BGP_LS_TLV_IP_REACHABILITY_INFORMATION:
|
||||||
mask_length = pnt_decode8(&pnt);
|
mask_length = pnt_decode8(&pnt);
|
||||||
if (nlri_type == BGP_LINKSTATE_PREFIX4 &&
|
if (nlri_type == BGP_LINKSTATE_PREFIX4) {
|
||||||
((length - sizeof(mask_length)) <= sizeof(ipv4.s_addr))) {
|
|
||||||
memcpy(&ipv4.s_addr, pnt, length - sizeof(mask_length));
|
memcpy(&ipv4.s_addr, pnt, length - sizeof(mask_length));
|
||||||
if (json)
|
if (json)
|
||||||
json_object_string_addf(json, "ipReachability",
|
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",
|
snprintfrr(buf, size, "%sIPv4:%pI4/%u",
|
||||||
first ? "" : " ", &ipv4,
|
first ? "" : " ", &ipv4,
|
||||||
mask_length);
|
mask_length);
|
||||||
} else if (nlri_type == BGP_LINKSTATE_PREFIX6 &&
|
} else if (nlri_type == BGP_LINKSTATE_PREFIX6) {
|
||||||
((length - sizeof(mask_length)) <= sizeof(ipv6))) {
|
|
||||||
memcpy(&ipv6, pnt, length - sizeof(mask_length));
|
memcpy(&ipv6, pnt, length - sizeof(mask_length));
|
||||||
if (json)
|
if (json)
|
||||||
json_object_string_addf(json, "ipReachability",
|
json_object_string_addf(json, "ipReachability",
|
||||||
|
Loading…
Reference in New Issue
Block a user