upstream: fix panic on malformed RPL_CHANNELMODEIS
This commit is contained in:
parent
87b75c44d2
commit
8e0c256c47
|
@ -1389,8 +1389,10 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
modeStr := ""
|
modeStr := ""
|
||||||
|
var modeArgs []string
|
||||||
if len(msg.Params) > 2 {
|
if len(msg.Params) > 2 {
|
||||||
modeStr = msg.Params[2]
|
modeStr = msg.Params[2]
|
||||||
|
modeArgs = msg.Params[3:]
|
||||||
}
|
}
|
||||||
|
|
||||||
ch := uc.channels.Get(channel)
|
ch := uc.channels.Get(channel)
|
||||||
|
@ -1401,7 +1403,7 @@ func (uc *upstreamConn) handleMessage(ctx context.Context, msg *irc.Message) err
|
||||||
|
|
||||||
firstMode := ch.modes == nil
|
firstMode := ch.modes == nil
|
||||||
ch.modes = make(map[byte]string)
|
ch.modes = make(map[byte]string)
|
||||||
if err := applyChannelModes(ch, modeStr, msg.Params[3:]); err != nil {
|
if err := applyChannelModes(ch, modeStr, modeArgs); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue