mirror of
https://github.com/curl/curl.git
synced 2025-01-18 14:04:30 +08:00
socks: fix incorrect port number in SOCKS4 error message
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: https://github.com/curl/curl/issues/1892 Reported-by: Jackarain@users.noreply.github.com
This commit is contained in:
parent
c8666089c8
commit
6d436642dd
@ -306,7 +306,7 @@ CURLcode Curl_SOCKS4(const char *proxy_user,
|
|||||||
", request rejected or failed.",
|
", request rejected or failed.",
|
||||||
(unsigned char)socksreq[4], (unsigned char)socksreq[5],
|
(unsigned char)socksreq[4], (unsigned char)socksreq[5],
|
||||||
(unsigned char)socksreq[6], (unsigned char)socksreq[7],
|
(unsigned char)socksreq[6], (unsigned char)socksreq[7],
|
||||||
(((unsigned char)socksreq[8] << 8) | (unsigned char)socksreq[9]),
|
(((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3]),
|
||||||
(unsigned char)socksreq[1]);
|
(unsigned char)socksreq[1]);
|
||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
case 92:
|
case 92:
|
||||||
@ -316,7 +316,7 @@ CURLcode Curl_SOCKS4(const char *proxy_user,
|
|||||||
"identd on the client.",
|
"identd on the client.",
|
||||||
(unsigned char)socksreq[4], (unsigned char)socksreq[5],
|
(unsigned char)socksreq[4], (unsigned char)socksreq[5],
|
||||||
(unsigned char)socksreq[6], (unsigned char)socksreq[7],
|
(unsigned char)socksreq[6], (unsigned char)socksreq[7],
|
||||||
(((unsigned char)socksreq[8] << 8) | (unsigned char)socksreq[9]),
|
(((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3]),
|
||||||
(unsigned char)socksreq[1]);
|
(unsigned char)socksreq[1]);
|
||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
case 93:
|
case 93:
|
||||||
@ -326,7 +326,7 @@ CURLcode Curl_SOCKS4(const char *proxy_user,
|
|||||||
"report different user-ids.",
|
"report different user-ids.",
|
||||||
(unsigned char)socksreq[4], (unsigned char)socksreq[5],
|
(unsigned char)socksreq[4], (unsigned char)socksreq[5],
|
||||||
(unsigned char)socksreq[6], (unsigned char)socksreq[7],
|
(unsigned char)socksreq[6], (unsigned char)socksreq[7],
|
||||||
(((unsigned char)socksreq[8] << 8) | (unsigned char)socksreq[9]),
|
(((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3]),
|
||||||
(unsigned char)socksreq[1]);
|
(unsigned char)socksreq[1]);
|
||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
default:
|
default:
|
||||||
@ -335,7 +335,7 @@ CURLcode Curl_SOCKS4(const char *proxy_user,
|
|||||||
", Unknown.",
|
", Unknown.",
|
||||||
(unsigned char)socksreq[4], (unsigned char)socksreq[5],
|
(unsigned char)socksreq[4], (unsigned char)socksreq[5],
|
||||||
(unsigned char)socksreq[6], (unsigned char)socksreq[7],
|
(unsigned char)socksreq[6], (unsigned char)socksreq[7],
|
||||||
(((unsigned char)socksreq[8] << 8) | (unsigned char)socksreq[9]),
|
(((unsigned char)socksreq[2] << 8) | (unsigned char)socksreq[3]),
|
||||||
(unsigned char)socksreq[1]);
|
(unsigned char)socksreq[1]);
|
||||||
return CURLE_COULDNT_CONNECT;
|
return CURLE_COULDNT_CONNECT;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user