3
0
mirror of https://github.com/ergochat/ergo.git synced 2025-06-06 23:07:32 +02:00

Merge pull request #2249 from slingamn/targetspanic

validate that CHATHISTORY limit parameters are nonnegative
This commit is contained in:
Shivaram Lingamneni 2025-04-24 23:37:32 -04:00 committed by GitHub
commit 2cf569c5d9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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