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
+1 -1
View File
@@ -765,7 +765,7 @@ func chathistoryHandler(server *Server, client *Client, msg ircmsg.Message, rb *
return maxChathistoryLimit return maxChathistoryLimit
} }
limit, err := strconv.Atoi(msg.Params[paramIndex]) limit, err := strconv.Atoi(msg.Params[paramIndex])
if err != nil || limit == 0 || limit > maxChathistoryLimit { if err != nil || limit <= 0 || limit > maxChathistoryLimit {
limit = maxChathistoryLimit limit = maxChathistoryLimit
} }
return return