From 616e9f0d9f0458788adf4b30707016c8db383b02 Mon Sep 17 00:00:00 2001 From: Philippe Guibert Date: Fri, 10 Feb 2023 18:12:48 +0100 Subject: [PATCH] bgpd: handle case where passed RD is null The function vpn_leak_to_vrf_update_onevrf() has the RD parameter set to NULL. Test the RD value before displaying it in the called function. Signed-off-by: Philippe Guibert --- bgpd/bgp_mplsvpn.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bgpd/bgp_mplsvpn.c b/bgpd/bgp_mplsvpn.c index a892fe261c..4aa37b8598 100644 --- a/bgpd/bgp_mplsvpn.c +++ b/bgpd/bgp_mplsvpn.c @@ -1907,7 +1907,8 @@ static bool vpn_leak_to_vrf_update_onevrf(struct bgp *to_bgp, /* to */ return false; } - if (debug) + rd_buf[0] = '\0'; + if (debug && prd) prefix_rd2str(prd, rd_buf, sizeof(rd_buf), to_bgp->asnotation); /* A route MUST NOT ever be accepted back into its source VRF, even if