3
0
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:
Shivaram Lingamneni 2025-04-24 12:33:53 -04:00
parent 5bab190d33
commit a4194c38d8

View File

@ -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