diff options
author | Hubert Hirtz <hubert@hirtz.pm> | 2021-11-02 20:37:46 +0100 |
---|---|---|
committer | Hubert Hirtz <hubert@hirtz.pm> | 2021-11-02 20:38:31 +0100 |
commit | 4433cc0f15b7e4e027da12949da33fe1975555bc (patch) | |
tree | bfb712abcea707fb56b74cd695bffb6d46e2771e | |
parent | Mark hyperlinks with the OSC hyperlink terminal escape (diff) |
Ensure BATCH's first arg is not empty
-rw-r--r-- | irc/session.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/irc/session.go b/irc/session.go index 201f50c..139e90e 100644 --- a/irc/session.go +++ b/irc/session.go @@ -973,8 +973,11 @@ func (s *Session) handleRegistered(msg Message) (Event, error) { if err := msg.ParseParams(&id); err != nil { return nil, err } + if len(id) == 0 { + return nil, fmt.Errorf("empty batch id") + } - batchStart := id[0] == '+' // id is not empty since it's not a trailing param + batchStart := id[0] == '+' id = id[1:] if batchStart { |