fix sys/leases panic when lease_id is nil (#18951)

* fix sys/leases panic when lease_id is nil

* add changelog entry
This commit is contained in:
Chris Capurso 2023-02-03 09:51:10 -05:00 committed by GitHub
parent 10dd6614fe
commit c74c057bdb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

3
changelog/18951.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:bug
core: Prevent panics in `sys/leases/lookup`, `sys/leases/revoke`, and `sys/leases/renew` endpoints if provided `lease_id` is null
```

View File

@ -632,7 +632,7 @@ func (c *Core) handleCancelableRequest(ctx context.Context, req *logical.Request
case "sys/leases/lookup", "sys/leases/renew", "sys/leases/revoke", "sys/leases/revoke-force":
leaseID, ok := req.Data["lease_id"]
// If lease ID is not present, break out and let the backend handle the error
if !ok {
if !ok || leaseID == nil {
break
}
_, nsID := namespace.SplitIDFromString(leaseID.(string))