security: fix AliasCheck panic (#21339)

* security: fix AliasCheck panic

* add changelog
This commit is contained in:
Deniz Onur Duzgun 2024-06-14 11:03:10 -04:00 committed by GitHub
parent 6302ef31fc
commit 7a19d2e7a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 0 deletions

3
.changelog/21339.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
core: Fix panic runtime error on AliasCheck
```

View File

@ -144,6 +144,9 @@ func (c *CheckAlias) runLocal(stopCh chan struct{}) {
type CheckIfServiceIDExists func(*structs.ServiceID) bool type CheckIfServiceIDExists func(*structs.ServiceID) bool
func (c *CheckAlias) checkServiceExistsOnRemoteServer(serviceID *structs.ServiceID) (bool, error) { func (c *CheckAlias) checkServiceExistsOnRemoteServer(serviceID *structs.ServiceID) (bool, error) {
if serviceID == nil {
return false, fmt.Errorf("serviceID cannot be nil")
}
args := c.RPCReq args := c.RPCReq
args.Node = c.Node args.Node = c.Node
args.AllowStale = true args.AllowStale = true