From 8a00500231af4885ea38e69cd2fb9a83a9bbe771 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 7b304c7fbc..6f5af5182a 100644 --- a/bgpd/rfapi/rfapi_import.c +++ b/bgpd/rfapi/rfapi_import.c @@ -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]; -- 2.39.5