fix #2324 (#2325)
Some checks failed
build / build (push) Has been cancelled
ghcr / Build (push) Has been cancelled

Validate user limit parameter
This commit is contained in:
Shivaram Lingamneni 2026-01-10 18:57:49 -05:00 committed by GitHub
parent 5c0af196da
commit 2da19a0760
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -251,9 +251,11 @@ func (channel *Channel) ApplyChannelModeChanges(client *Client, isSamode bool, c
switch change.Op {
case modes.Add:
val, err := strconv.Atoi(change.Arg)
if err == nil {
if err == nil && val > 0 {
channel.setUserLimit(val)
applied = append(applied, change)
} else {
rb.Add(nil, client.server.name, ERR_INVALIDMODEPARAM, details.nick, chname, string(change.Mode), utils.SafeErrorParam(change.Arg), client.t("+l user limit value must be an integer between 1 and 2147483647, expressed in base 10"))
}
case modes.Remove: