Check for nil value in BarrierView.Put (#4804)

Fixes #4802
This commit is contained in:
Jeff Mitchell 2018-06-20 09:32:06 -04:00 committed by GitHub
parent bf33d5d849
commit c6180c57c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -89,6 +89,10 @@ func (v *BarrierView) Get(ctx context.Context, key string) (*logical.StorageEntr
// logical.Storage impl.
func (v *BarrierView) Put(ctx context.Context, entry *logical.StorageEntry) error {
if entry == nil {
return errors.New("cannot write nil entry")
}
if err := v.sanityCheck(entry.Key); err != nil {
return err
}