From ef87de9d8888726bb77cc921a69e0ffddb885740 Mon Sep 17 00:00:00 2001 From: Steven Roose Date: Tue, 6 Jun 2017 18:35:57 +0200 Subject: [PATCH] Fix comparator that could cause a panic --- connmgr/tor.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/connmgr/tor.go b/connmgr/tor.go index 84f5f763..2b22ae51 100644 --- a/connmgr/tor.go +++ b/connmgr/tor.go @@ -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