Skip to content

Commit

Permalink
Backport of security: fix AliasCheck panic (update) into release/1.19…
Browse files Browse the repository at this point in the history
….x (#21511)

backport of commit 8c3682a

Co-authored-by: Kiran Naidoo <[email protected]>
  • Loading branch information
hc-github-team-consul-core and kkzo authored Jul 3, 2024
1 parent 73d46d6 commit 1e3ea57
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions agent/checks/alias.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,12 @@ RETRY_CALL:
}
return false, err
}

// Do not proceed for nil returned services.
if out.NodeServices == nil {
return false, fmt.Errorf("no services found on node")
}

for _, srv := range out.NodeServices.Services {
if serviceID.Matches(srv.CompoundServiceID()) {
return true, nil
Expand Down

0 comments on commit 1e3ea57

Please sign in to comment.