mirror of
https://github.com/xcat2/confluent.git
synced 2025-07-01 18:35:41 +00:00
Fix for tokens with null bytes
Since the server may employ the full range of byte values in the echo token, use that length and the buffer to avoid nulls truncating the token.
This commit is contained in:
@ -109,7 +109,9 @@ int main(int argc, char* argv[]) {
|
||||
read(sock, buffer, currlen); // Max is 255, well under MAX_PACKET
|
||||
}
|
||||
if (currtype == 2) {
|
||||
dprintf(sock, "\x03%c%s\x04%c%s", strlen(buffer), buffer, strlen(cryptedpass), cryptedpass);
|
||||
dprintf(sock, "\x03%c", currlen);
|
||||
write(sock, buffer, currlen);
|
||||
dprintf(sock, "\x04%c%s", strlen(cryptedpass), cryptedpass);
|
||||
write(sock, "\x00\x00", 2);
|
||||
} else if (currtype == 5) {
|
||||
printf(passwd);
|
||||
|
Reference in New Issue
Block a user