aboutsummaryrefslogtreecommitdiff
path: root/bytesconv.go
diff options
context:
space:
mode:
authorGravatar Erik Dubbelboer <erik@dubbelboer.com> 2018-11-14 01:59:18 +0800
committerGravatar Erik Dubbelboer <erik@dubbelboer.com> 2018-11-14 01:59:18 +0800
commit8a9bdc8177d5b4681dd09bb34e7b00170b05e342 (patch)
tree6e7dbe9d231caa7d76e36e3ecceb8c387d8709b6 /bytesconv.go
parentfix go vet do not work on noCopy (diff)
downloadfasthttp-8a9bdc8177d5b4681dd09bb34e7b00170b05e342.tar.gz
fasthttp-8a9bdc8177d5b4681dd09bb34e7b00170b05e342.tar.bz2
fasthttp-8a9bdc8177d5b4681dd09bb34e7b00170b05e342.zip
Fix ParseUint to support all possible numbers
Fixes #461
Diffstat (limited to 'bytesconv.go')
-rw-r--r--bytesconv.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/bytesconv.go b/bytesconv.go
index 6292957..9631e9c 100644
--- a/bytesconv.go
+++ b/bytesconv.go
@@ -183,7 +183,8 @@ func parseUintBuf(b []byte) (int, int, error) {
}
return v, i, nil
}
- if i >= maxIntChars {
+ // Test for overflow.
+ if v*10 < v {
return -1, i, errTooLongInt
}
v = 10*v + int(k)