Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client: verify payload of SubscribeMultiple is not empty #385

Merged
merged 1 commit into from Dec 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions topic.go
Expand Up @@ -50,6 +50,10 @@ var ErrInvalidTopicMultilevel = errors.New("Invalid Topic; multi-level wildcard
// Example: a subscription to "foo/#" will match messages published to "foo".

func validateSubscribeMap(subs map[string]byte) ([]string, []byte, error) {
if len(subs) == 0 {
return nil, nil, errors.New("Invalid subscription; subscribe map must not be empty")
}

var topics []string
var qoss []byte
for topic, qos := range subs {
Expand Down