mirror of
https://github.com/ergochat/ergo.git
synced 2025-06-09 00:07:44 +02:00
validate that CHATHISTORY limit parameters are nonnegative
See #2248. Reported by @prdes
This commit is contained in:
parent
5bab190d33
commit
a4194c38d8
@ -765,7 +765,7 @@ func chathistoryHandler(server *Server, client *Client, msg ircmsg.Message, rb *
|
||||
return maxChathistoryLimit
|
||||
}
|
||||
limit, err := strconv.Atoi(msg.Params[paramIndex])
|
||||
if err != nil || limit == 0 || limit > maxChathistoryLimit {
|
||||
if err != nil || limit <= 0 || limit > maxChathistoryLimit {
|
||||
limit = maxChathistoryLimit
|
||||
}
|
||||
return
|
||||
|
Loading…
x
Reference in New Issue
Block a user