From d0a755a372ef2c24f921c1cc2c4eb20b48a75a9a Mon Sep 17 00:00:00 2001 From: Renato Westphal Date: Fri, 19 Oct 2018 15:54:57 -0300 Subject: [PATCH] bgpd: add a NULL check to prevent a crash in the rfapi code 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 --- bgpd/rfapi/rfapi_import.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bgpd/rfapi/rfapi_import.c b/bgpd/rfapi/rfapi_import.c index ac3b6da23..1cfeb1ea7 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -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]; -- 2.39.5