From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LAQm9-0004GG-7b for qemu-devel@nongnu.org; Wed, 10 Dec 2008 10:14:57 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LAQm7-0004FC-9r for qemu-devel@nongnu.org; Wed, 10 Dec 2008 10:14:56 -0500 Received: from [199.232.76.173] (port=43493 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LAQm7-0004F7-6C for qemu-devel@nongnu.org; Wed, 10 Dec 2008 10:14:55 -0500 Received: from an-out-0708.google.com ([209.85.132.251]:38747) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LAQm6-0000MO-VH for qemu-devel@nongnu.org; Wed, 10 Dec 2008 10:14:55 -0500 Received: by an-out-0708.google.com with SMTP id c38so235684ana.37 for ; Wed, 10 Dec 2008 07:14:54 -0800 (PST) Message-ID: <493FDCE9.2060204@codemonkey.ws> Date: Wed, 10 Dec 2008 09:14:49 -0600 From: Anthony Liguori MIME-Version: 1.0 References: <20081123113147.GA12832@arachsys.com> <20081123123101.GC17042@networkno.de> <20081125100935.GI2380@arachsys.com> <20081208140930.GF19711@arachsys.com> In-Reply-To: <20081208140930.GF19711@arachsys.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] Re: [RESEND] [PATCH v2] Fix off-by-one bug limiting VNC passwords to 7 chars Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chris Webb Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org Applied. Thanks. Regards, Anthony Liguori Chris Webb wrote: > Fix off-by-one bug limiting VNC passwords to 7 characters instead of 8 > > monitor_readline expects buf_size to include the terminating \0, but > do_change_vnc in monitor.c calls it as though it doesn't. The other site > where monitor_readline reads a password (in vl.c) passes the buffer length > correctly. > > Signed-off-by: Chris Webb > --- > monitor.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/monitor.c b/monitor.c > index 22360fc..a252838 100644 > --- a/monitor.c > +++ b/monitor.c > @@ -433,8 +433,7 @@ static void do_change_vnc(const char *target) > if (strcmp(target, "passwd") == 0 || > strcmp(target, "password") == 0) { > char password[9]; > - monitor_readline("Password: ", 1, password, sizeof(password)-1); > - password[sizeof(password)-1] = '\0'; > + monitor_readline("Password: ", 1, password, sizeof(password)); > if (vnc_display_password(NULL, password) < 0) > term_printf("could not set VNC server password\n"); > } else { > > -- > To unsubscribe from this list: send the line "unsubscribe kvm" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html >