From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0480-0006px-Qr for qemu-devel@nongnu.org; Fri, 28 Oct 2016 06:11:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c047x-0005gv-GI for qemu-devel@nongnu.org; Fri, 28 Oct 2016 06:11:12 -0400 Received: from indium.canonical.com ([91.189.90.7]:45051) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1c047x-0005gS-AI for qemu-devel@nongnu.org; Fri, 28 Oct 2016 06:11:09 -0400 Received: from loganberry.canonical.com ([91.189.90.37]) by indium.canonical.com with esmtp (Exim 4.76 #1 (Debian)) id 1c047u-0007iA-WC for ; Fri, 28 Oct 2016 10:11:07 +0000 Received: from loganberry.canonical.com (localhost [127.0.0.1]) by loganberry.canonical.com (Postfix) with ESMTP id 5CF4B2E80DF for ; Fri, 28 Oct 2016 10:11:05 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Date: Fri, 28 Oct 2016 10:00:03 -0000 From: Daniel Berrange <1637447@bugs.launchpad.net> Reply-To: Bug 1637447 <1637447@bugs.launchpad.net> Sender: bounces@canonical.com References: <20161028093031.16469.50340.malonedeb@chaenomeles.canonical.com> Message-Id: <20161028100003.16535.16049.malone@chaenomeles.canonical.com> Errors-To: bounces@canonical.com Subject: [Qemu-devel] [Bug 1637447] Re: VNC/RFB: QEMU reports incorrect name (length) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org The right fix here is to switch to use g_strdup_printf and avoid a fixed length stack buffer entirely. -- = You received this bug notification because you are a member of qemu- devel-ml, which is subscribed to QEMU. https://bugs.launchpad.net/bugs/1637447 Title: VNC/RFB: QEMU reports incorrect name (length) Status in QEMU: New Bug description: If the name of a machine (as set with the -name argument) has a length longer than 1024, (RFB) VNC clients will not receive a correct RFB ServerInit message. I suspect this is the problem: https://github.com/qemu/qemu/blob/v2.7.0-rc5/ui/vnc.c#L2459 The return value of snprintf is used as the value for the name-length fie= ld in the ServerInit message. This is problematic for names that were truncated to 1024, as the length = will now be bigger than the actual name. I think a quick fix would be to simply report min(size,1024) to the client... To manage notifications about this bug go to: https://bugs.launchpad.net/qemu/+bug/1637447/+subscriptions