mirror of https://github.com/status-im/consul.git
security: fix AliasCheck panic (update) (#21510)
Updated `checkServiceExistsOnRemoteServer` to ensure there are services returned from the specified node before proceeding with the service matcher.
This commit is contained in:
parent
6f31bfebbe
commit
88bade6cc0
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue