Skip to content

Commit

Permalink
isisd: fix area NULL pointer in isis_route_update
Browse files Browse the repository at this point in the history
Fix the case area is NULL.

Fixes: acc0029 ("isisd: fix potential access to NULL pointer in isis_route_update")
Signed-off-by: Louis Scalbert <[email protected]>
  • Loading branch information
louis-6wind committed Nov 17, 2022
1 parent e07ff2c commit 41c2bf8
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions isisd/isis_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,16 +485,18 @@ static void isis_route_update(struct isis_area *area, struct prefix *prefix,
struct prefix_ipv6 *src_p,
struct isis_route_info *route_info)
{
if (area == NULL)
return;

if (CHECK_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ACTIVE)) {
if (CHECK_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED))
return;

isis_route_remove_previous_sid(area, prefix, route_info);

/* Install route. */
if (area)
isis_zebra_route_add_route(area->isis, prefix, src_p,
route_info);
isis_zebra_route_add_route(area->isis, prefix, src_p,
route_info);
/* Install/reinstall Prefix-SID label. */
if (route_info->sr.present)
isis_zebra_prefix_sid_install(area, prefix, route_info,
Expand All @@ -509,9 +511,8 @@ static void isis_route_update(struct isis_area *area, struct prefix *prefix,
isis_zebra_prefix_sid_uninstall(
area, prefix, route_info, &route_info->sr);
/* Uninstall route. */
if (area)
isis_zebra_route_del_route(area->isis, prefix, src_p,
route_info);
isis_zebra_route_del_route(area->isis, prefix, src_p,
route_info);
hook_call(isis_route_update_hook, area, prefix, route_info);

UNSET_FLAG(route_info->flag, ISIS_ROUTE_FLAG_ZEBRA_SYNCED);
Expand Down

0 comments on commit 41c2bf8

Please sign in to comment.