fix a bug that when using socks5 with authentication, username and password can't sent to server correctly (#856)

This commit is contained in:
离披
2022-06-23 13:09:51 +08:00
committed by GitHub
parent 2b7483b696
commit 0aa4a981fc

View File

@@ -89,10 +89,10 @@ bool SocksHelper::Handshake(SOCKET client)
}
/* Password */
buffer[1 + plength] = 0x00;
buffer[1 + 1 + ulength] = 0x00;
if (plength != 0)
{
buffer[1 + ulength] = plength;
buffer[1 + 1 + ulength] = plength;
memcpy(buffer + 1 + 1 + ulength + 1, tgtPassword.c_str(), plength);
}