]> git.proxmox.com Git - mirror_frr.git/commitdiff
bgpd: add a NULL check to prevent a crash in the rfapi code
authorRenato Westphal <renato@opensourcerouting.org>
Fri, 19 Oct 2018 18:54:57 +0000 (15:54 -0300)
committerRenato Westphal <renato@opensourcerouting.org>
Sat, 20 Oct 2018 15:39:05 +0000 (12:39 -0300)
The rfapiDeleteRemotePrefixesIt() function checks on several places if
'p' is NULL or not. Introduce an additional NULL check to prevent a
crash from happening.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
bgpd/rfapi/rfapi_import.c

index 7b304c7fbcce4cdf289ad525d2c7cb3f9058e779..6f5af5182a8d2dae4c9545c3d1ba6a3842bb1231 100644 (file)
@@ -4485,7 +4485,7 @@ static void rfapiDeleteRemotePrefixesIt(
                        struct bgp_path_info *bpi;
                        struct bgp_path_info *next;
 
-                       if (VNC_DEBUG(IMPORT_DEL_REMOTE)) {
+                       if (p && VNC_DEBUG(IMPORT_DEL_REMOTE)) {
                                char p1line[PREFIX_STRLEN];
                                char p2line[PREFIX_STRLEN];