From 54ed53f36f42b52fd84ad010d31031454f20bd13 Mon Sep 17 00:00:00 2001 From: Donald Sharp Date: Fri, 5 Jan 2024 13:24:59 -0500 Subject: [PATCH] zebra: SA incorrectly believes a NULL pointer SA has decided that old_re could be a NULL pointer even though the zebra_redistribute_check function checks for NULL and returns false that would not allow a NULL pointer deref. Signed-off-by: Donald Sharp --- zebra/redistribute.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/zebra/redistribute.c b/zebra/redistribute.c index 18eac0044a..70ace35a86 100644 --- a/zebra/redistribute.c +++ b/zebra/redistribute.c @@ -332,6 +332,14 @@ void redistribute_delete(const struct route_node *rn, /* Send a delete for the 'old' re to any subscribed client. */ if (zebra_redistribute_check(rn, old_re, client)) { + /* + * SA is complaining that old_re could be false + * SA is wrong because old_re is checked for NULL + * in zebra_redistribute_check and false is + * returned in that case. Let's just make SA + * happy. + */ + assert(old_re); is_table_direct = zebra_redistribute_is_table_direct(old_re); zsend_redistribute_route(ZEBRA_REDISTRIBUTE_ROUTE_DEL, client, rn, old_re, -- 2.39.5