Fix comparator that could cause a panic
This commit is contained in:
parent
bf43e56f2f
commit
ef87de9d88
1 changed files with 1 additions and 1 deletions
|
@ -99,7 +99,7 @@ func TorLookupIP(host, proxy string) ([]net.IP, error) {
|
|||
return nil, ErrTorInvalidProxyResponse
|
||||
}
|
||||
if buf[1] != 0 {
|
||||
if int(buf[1]) > len(torStatusErrors) {
|
||||
if int(buf[1]) >= len(torStatusErrors) {
|
||||
return nil, ErrTorInvalidProxyResponse
|
||||
} else if err := torStatusErrors[buf[1]]; err != nil {
|
||||
return nil, err
|
||||
|
|
Loading…
Reference in a new issue