Block the broadcast of an empty message

This commit is contained in:
Ken Piper 2014-12-13 10:57:38 -05:00
parent 857dcd0a14
commit 25dc161348

View File

@ -229,7 +229,7 @@ func (c *Client) handleShell(channel ssh.Channel) {
} }
msg := fmt.Sprintf("%s: %s", c.ColoredName(), line) msg := fmt.Sprintf("%s: %s", c.ColoredName(), line)
if c.IsSilenced() || len(msg) > 1000 { if c.IsSilenced() || len(msg) > 1000 || len(line) < 1 {
c.Msg <- fmt.Sprintf("-> Message rejected.") c.Msg <- fmt.Sprintf("-> Message rejected.")
continue continue
} }