CTCP Messages must be more then 2 characters long.
Avoid panic on malformed CTCP messages.
This commit is contained in:
parent
47e552f62d
commit
087ae892d0
@ -77,7 +77,7 @@ func (irc *Connection) ReplaceCallback(eventcode string, i string, callback func
|
||||
// Execute all callbacks associated with a given event.
|
||||
func (irc *Connection) RunCallbacks(event *Event) {
|
||||
msg := event.Message()
|
||||
if event.Code == "PRIVMSG" && len(msg) > 0 && msg[0] == '\x01' {
|
||||
if event.Code == "PRIVMSG" && len(msg) > 2 && msg[0] == '\x01' {
|
||||
event.Code = "CTCP" //Unknown CTCP
|
||||
|
||||
if i := strings.LastIndex(msg, "\x01"); i > -1 {
|
||||
|
Loading…
Reference in New Issue
Block a user