mirror of
https://github.com/xcat2/confluent.git
synced 2025-02-12 00:30:33 +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:
parent
c1abeaff04
commit
aaf5aebff7
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user