mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 10:09:25 +00:00
bgpd: fix bgp_info_addpath_{rx,tx}_str if addpath info is not present
The buffer needs to be set to length 0 if nothing is written into it, otherwise bgpd will log uninitialized memory, disclosing information and possibly leading to a crash. Signed-off-by: Christian Franke <chris@opensourcerouting.org>
This commit is contained in:
parent
b2184d8adc
commit
b79d6f95a3
@ -2281,6 +2281,8 @@ bgp_info_addpath_rx_str(u_int32_t addpath_id, char *buf)
|
||||
{
|
||||
if (addpath_id)
|
||||
sprintf(buf, " with addpath ID %d", addpath_id);
|
||||
else
|
||||
buf[0] = '\0';
|
||||
}
|
||||
|
||||
|
||||
|
@ -619,6 +619,8 @@ bgp_info_addpath_tx_str (int addpath_encode, u_int32_t addpath_tx_id,
|
||||
{
|
||||
if (addpath_encode)
|
||||
sprintf(buf, " with addpath ID %d", addpath_tx_id);
|
||||
else
|
||||
buf[0] = '\0';
|
||||
}
|
||||
|
||||
/* Make BGP update packet. */
|
||||
|
Loading…
Reference in New Issue
Block a user