Merge pull request #4904 from hashicorp/b-vault-panic

vault: fix panic by checking for nil secret
This commit is contained in:
Michael Schurter 2018-11-20 12:09:35 -06:00 committed by GitHub
commit 1f61a925c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -547,6 +547,11 @@ func (v *vaultClient) renew() error {
if err != nil { if err != nil {
return err return err
} }
if secret == nil {
// It's possible for RenewSelf to return (nil, nil) if the
// response body from Vault is empty.
return fmt.Errorf("renewal failed: empty response from vault")
}
auth := secret.Auth auth := secret.Auth
if auth == nil { if auth == nil {