mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-06 14:29:47 +00:00
bgpd: protect bgp printfrr extension from NULLs
Protect the bgp printfrr extension from NULL input. Signed-off-by: Mark Stapp <mjs@voltanet.io>
This commit is contained in:
parent
0a1e7b612a
commit
001ab42b19
@ -205,8 +205,14 @@ static ssize_t printfrr_bd(char *buf, size_t bsz, const char *fmt,
|
||||
int prec, const void *ptr)
|
||||
{
|
||||
const struct bgp_dest *dest = ptr;
|
||||
const struct prefix *p = bgp_dest_get_prefix(dest);
|
||||
const struct prefix *p;
|
||||
|
||||
if (dest) {
|
||||
p = bgp_dest_get_prefix(dest);
|
||||
prefix2str(p, buf, bsz);
|
||||
} else {
|
||||
strlcpy(buf, "NULL", bsz);
|
||||
}
|
||||
|
||||
prefix2str(p, buf, bsz);
|
||||
return 2;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user