From: Renato Westphal Date: Fri, 19 Oct 2018 18:54:57 +0000 (-0300) Subject: bgpd: add a NULL check to prevent a crash in the rfapi code X-Git-Tag: frr-7.1-dev~253^2~7 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=8a00500231af4885ea38e69cd2fb9a83a9bbe771;p=mirror%2Ffrr.git 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 --- 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];