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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
addrlen is already increased by 1 to contain the ending \0 character in the string. When its value is assigned to the unsigned char in the data packet, it is subtracted by one:
(*out)[ 4 ] = (char)(uint8_t)(addrlen - 1);
Due to this, i chose to cap at addrlen > 256 because 256-1=255 can still be properly put into the length byte. The ending \0 is not needed in the protocol, otherwise google.commm[...] would have been parsed by the remote peer.
I could reduce the constant to 255. As yawning pointed out, the DNS lookup of the remote peer would fail anyway, but I prefer to support as much as the SOCKS5 protocol offers.
addrlen is already increased by 1 to contain the ending \0 character in the string. When its value is assigned to the unsigned char in the data packet, it is subtracted by one:
(*out)[ 4 ] = (char)(uint8_t)(addrlen - 1);
Due to this, i chose to cap at addrlen > 256 because 256-1=255 can still be properly put into the length byte. The ending \0 is not needed in the protocol, otherwise google.commm[...] would have been parsed by the remote peer.
I could reduce the constant to 255. As yawning pointed out, the DNS lookup of the remote peer would fail anyway, but I prefer to support as much as the SOCKS5 protocol offers.