New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
socks4 parse error #1892
Comments
Sorry but that doesn't make sense, the sockreq[4] is already shown as the first byte of the IP address. The short documentation in the comment above would however imply that index 2 and 3 are the ones that hold the port number. |
|
That's the comment I referred to. It mentions |
Prior to this change it appears the SOCKS5 port parsing was erroneously used for the SOCKS4 error message, and as a result an incorrect port would be shown in the error message. Bug: #1892 Reported-by: Jackarain@users.noreply.github.com
Thanks, landed in 6d43664. I worked on those lines last but I didn't catch it. It's been like that since it was added in 2006, see a15d107. My guess is it was copied over from some SOCKS5 error message parsing since in a SOCKS5 response the port comes after the ip address. |
curl/lib/socks.c
Line 309 in c866608
curl/lib/socks.c
Line 319 in c866608
curl/lib/socks.c
Line 329 in c866608
curl/lib/socks.c
Line 338 in c866608
should be:
(((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3])
The text was updated successfully, but these errors were encountered: