mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-20 02:00:11 -08:00
Merge pull request #2249 from slingamn/targetspanic
validate that CHATHISTORY limit parameters are nonnegative
This commit is contained in:
commit
2cf569c5d9
1 changed files with 1 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue