mirror of
https://github.com/kaspanet/kaspad.git
synced 2025-06-07 14:46:44 +00:00
Fix comparator that could cause a panic
This commit is contained in:
parent
bf43e56f2f
commit
ef87de9d88
@ -99,7 +99,7 @@ func TorLookupIP(host, proxy string) ([]net.IP, error) {
|
|||||||
return nil, ErrTorInvalidProxyResponse
|
return nil, ErrTorInvalidProxyResponse
|
||||||
}
|
}
|
||||||
if buf[1] != 0 {
|
if buf[1] != 0 {
|
||||||
if int(buf[1]) > len(torStatusErrors) {
|
if int(buf[1]) >= len(torStatusErrors) {
|
||||||
return nil, ErrTorInvalidProxyResponse
|
return nil, ErrTorInvalidProxyResponse
|
||||||
} else if err := torStatusErrors[buf[1]]; err != nil {
|
} else if err := torStatusErrors[buf[1]]; err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
Loading…
x
Reference in New Issue
Block a user