Disallow writing to empty paths (#5702)

This commit is contained in:
Vishal Nayak 2018-11-06 14:08:55 -05:00 committed by GitHub
parent ef8f40647a
commit 0b5ea9917e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -167,6 +167,10 @@ func (b *PassthroughBackend) GeneratesLeases() bool {
}
func (b *PassthroughBackend) handleWrite(ctx context.Context, req *logical.Request, data *framework.FieldData) (*logical.Response, error) {
if req.Path == "" {
return logical.ErrorResponse("missing path"), nil
}
// Check that some fields are given
if len(req.Data) == 0 {
return logical.ErrorResponse("missing data fields"), nil