Skip to content
Commit 8a656259 authored by Thomas Huth's avatar Thomas Huth Committed by Michael Roth
Browse files

ui/vnc: Fix problem with sending too many bytes as server name

If the buffer is not big enough, snprintf() does not return the number
of bytes that have been written to the buffer, but the number of bytes
that would be needed for writing the whole string. By using this value
for the following vnc_write() calls, we send some junk at the end of
the name in case the qemu_name is longer than 1017 bytes, which could
confuse the VNC clients. Fix this by adding an additional size check
here.

Buglink: https://bugs.launchpad.net/qemu/+bug/1637447


Signed-off-by: default avatarThomas Huth <thuth@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Message-id: 1479749115-21932-1-git-send-email-thuth@redhat.com
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
(cherry picked from commit 97efe4f9)
Signed-off-by: default avatarMichael Roth <mdroth@linux.vnet.ibm.com>
parent 9f6cb916
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment