mirror of
https://github.com/ergochat/ergo.git
synced 2025-06-07 15:27:41 +02:00
Merge pull request #2249 from slingamn/targetspanic
validate that CHATHISTORY limit parameters are nonnegative
This commit is contained in:
commit
2cf569c5d9
@ -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…
x
Reference in New Issue
Block a user