tor-resolve: Do not truncate too long hostnames
If a hostname is supplied to tor-resolve which is too long, it will be silently truncated, resulting in a different hostname lookup:
$ tor-resolve $(python -c 'print("google.com" + "m" * 256)')
If tor-resolve uses SOCKS5, the length is stored in an unsigned char, which overflows in this case and leads to the hostname "google.com". As this one is a valid hostname, it returns an address instead of giving an error due to the invalid supplied hostname.
Trac:
Username: junglefowl