mirror of
https://github.com/caddyserver/caddy.git
synced 2026-05-21 06:16:31 -04:00
mitm: Fix out of bounds error when checking software version in UA
This commit is contained in:
@@ -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, ".")
|
||||
|
||||
Reference in New Issue
Block a user