Skip to content

Commit

Permalink
libvncserver: fix fallback Latin1 sending in rfbSendServerCutTextUTF8()
Browse files Browse the repository at this point in the history
  • Loading branch information
bk138 committed Dec 19, 2024
1 parent 4b3b9d9 commit 5a464a2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/libvncserver/rfbserver.c
Original file line number Diff line number Diff line change
Expand Up @@ -4051,9 +4051,9 @@ rfbSendServerCutTextUTF8(rfbScreenInfoPtr rfbScreen,char *str, int len, char *fa
iterator = rfbGetClientIterator(rfbScreen);
while ((cl = rfbClientIteratorNext(iterator)) != NULL) {
sct.type = rfbServerCutText;
sct.length = Swap32IfLE(len);
LOCK(cl->sendMutex);
if (cl->enableExtendedClipboard) {
sct.length = Swap32IfLE(len);
if (cl->extClipboardData != NULL) {
free(cl->extClipboardData);
cl->extClipboardData = NULL;
Expand Down Expand Up @@ -4081,6 +4081,7 @@ rfbSendServerCutTextUTF8(rfbScreenInfoPtr rfbScreen,char *str, int len, char *fa
}
UNLOCK(cl->sendMutex);
} else if (fallbackLatin1Str != NULL) {
sct.length = Swap32IfLE(latin1Len);
if (rfbWriteExact(cl, (char *)&sct,
sz_rfbServerCutTextMsg) < 0) {
rfbLogPerror("rfbSendServerCutText: write");
Expand Down

0 comments on commit 5a464a2

Please sign in to comment.