Skip to content

Commit

Permalink
Error on PUBLISH with empty topic
Browse files Browse the repository at this point in the history
  • Loading branch information
mcollina committed Jul 21, 2017
1 parent dcaf4f7 commit 79e8854
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/handlers/publish.js
Expand Up @@ -19,6 +19,10 @@ var publishActions = [
function handlePublish (client, packet, done) {
var topic = packet.topic
var err
if (topic.length === 0) {
err = new Error('empty topic not allowed in PUBLISH')
return done(err)
}
for (var i = 0; i < topic.length; i++) {
switch (topic.charCodeAt(i)) {
case 35:
Expand Down

0 comments on commit 79e8854

Please sign in to comment.