mitm: Fix out of bounds error when checking software version in UA

This commit is contained in:
Matthew Holt
2017-07-25 13:00:49 -06:00
parent ae7e098240
commit 10d5422c3e
2 changed files with 47 additions and 0 deletions
+2
View File
@@ -112,6 +112,8 @@ func getVersion(ua, softwareName string) float64 {
end := strings.Index(ua[start:], " ")
if end < 0 {
end = len(ua)
} else {
end += start
}
strVer := strings.Replace(ua[start:end], "-", "", -1)
firstDot := strings.Index(strVer, ".")