This website works better with JavaScript.
Home
Explore
Help
Sign In
abunchtell
/
gopkg
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Activity
Browse Source
Check for integer overflow in parseVersionPart
master
GeertJohan
10 years ago
parent
8be904041c
commit
ed9d42974f
1 changed files
with
4 additions
and
1 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+4
-1
version.go
+ 4
- 1
version.go
View File
@@ -91,9 +91,12 @@ func parseVersionPart(s string, i int) (part int, newi int) {
}
part *= 10
part += int(s[i] - '0')
if part < 0 {
return -1, -1
}
i++
if i+1 < len(s) && s[i] == '.' {
return part, i+1
return part, i
+
1
}
}
return part, i
Write
Preview
Loading…
Cancel
Save