Skip to content

Commit

Permalink
security: fix AliasCheck panic (update) (#21510)
Browse files Browse the repository at this point in the history
Updated `checkServiceExistsOnRemoteServer` to ensure there are services
returned from the specified node before proceeding with the service
matcher.
  • Loading branch information
kkzo committed Jul 3, 2024
1 parent 6f31bfe commit 88bade6
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 88bade6

Please sign in to comment.