server: Actually send a reason when handshake fails

pull/93/head
Andri Yngvason 2023-07-04 22:56:52 +00:00
parent ade1046391
commit 61fad8c96b
1 changed files with 1 additions and 1 deletions

View File

@ -217,7 +217,7 @@ static int security_handshake_failed(struct nvnc_client* client,
*result = htonl(RFB_SECURITY_HANDSHAKE_FAILED); *result = htonl(RFB_SECURITY_HANDSHAKE_FAILED);
reason->length = htonl(strlen(reason_string)); reason->length = htonl(strlen(reason_string));
(void)strcmp(reason->message, reason_string); strcpy(reason->message, reason_string);
size_t len = sizeof(*result) + sizeof(*reason) + strlen(reason_string); size_t len = sizeof(*result) + sizeof(*reason) + strlen(reason_string);
stream_write(client->net_stream, buffer, len, close_after_write, stream_write(client->net_stream, buffer, len, close_after_write,