[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH for-2.8] ui/vnc: Fix problem with sending too ma
From: |
Eric Blake |
Subject: |
Re: [Qemu-devel] [PATCH for-2.8] ui/vnc: Fix problem with sending too many bytes as server name |
Date: |
Mon, 21 Nov 2016 11:31:36 -0600 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 |
On 11/21/2016 11:25 AM, Thomas Huth wrote:
> 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: Thomas Huth <address@hidden>
> ---
> ui/vnc.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Reviewed-by: Eric Blake <address@hidden>
Worth having in 2.8, I think.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
signature.asc
Description: OpenPGP digital signature