]> git.puffer.fish Git - matthieu/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>
Mon, 17 Dec 2018 14:14:05 +0000 (12:14 -0200)
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 ac3b6da23011472381e032e83278541e38c11d0f..1cfeb1ea7a09e4e06948af86426aa09ee0770b15 100644 (file)
@@ -4470,7 +4470,7 @@ static void rfapiDeleteRemotePrefixesIt(
                        struct bgp_info *bi;
                        struct bgp_info *next;
 
-                       if (VNC_DEBUG(IMPORT_DEL_REMOTE)) {
+                       if (p && VNC_DEBUG(IMPORT_DEL_REMOTE)) {
                                char p1line[PREFIX_STRLEN];
                                char p2line[PREFIX_STRLEN];