Fix int overflow

This commit is contained in:
Lan Tian 2020-04-10 12:38:33 +08:00
parent 43f087e51b
commit b974646749
No known key found for this signature in database
GPG Key ID: 27F31700E751EC22

View File

@ -115,11 +115,11 @@ func webHandlerTelegramBot(w http.ResponseWriter, r *http.Request) {
} else if telegramIsCommand(request.Message.Text, "whois") {
if setting.netSpecificMode == "dn42" {
targetNumber, err := strconv.Atoi(target)
targetNumber, err := strconv.ParseUint(target, 10, 64)
if err == nil {
if targetNumber < 10000 {
targetNumber += 4242420000
target = strconv.Itoa(targetNumber)
target = strconv.FormatUint(targetNumber, 10)
}
}
}