Skip to content

Commit

Permalink
zebra: SA incorrectly believes a NULL pointer
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
donaldsharp committed Jan 9, 2024
1 parent 3f03ec1 commit 54ed53f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions zebra/redistribute.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 54ed53f

Please sign in to comment.