From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L0Ixl-0007bE-GC for qemu-devel@nongnu.org; Wed, 12 Nov 2008 11:53:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L0Ixj-0007aO-Rp for qemu-devel@nongnu.org; Wed, 12 Nov 2008 11:53:05 -0500 Received: from [199.232.76.173] (port=35613 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L0Ixj-0007aB-FM for qemu-devel@nongnu.org; Wed, 12 Nov 2008 11:53:03 -0500 Received: from rv-out-0708.google.com ([209.85.198.241]:44485) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L0Ixj-0004Mb-07 for qemu-devel@nongnu.org; Wed, 12 Nov 2008 11:53:03 -0500 Received: by rv-out-0708.google.com with SMTP id f25so458451rvb.22 for ; Wed, 12 Nov 2008 08:53:01 -0800 (PST) Message-ID: Date: Wed, 12 Nov 2008 17:53:01 +0100 From: "andrzej zaborowski" Subject: Re: [Qemu-devel] r5531 made x509 certs not loadable [PATCH] In-Reply-To: <1226498200.6434.101.camel@henrik-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <1226498200.6434.101.camel@henrik-desktop> Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org 2008/11/12 Henrik Holst : > The patch in r5531 which replaced a bunch of strncpy with pstrcpy causes > the x509 credentials from the -vnc parameter to be one character shorter > than entered meaning that there is currently no way to enter x509 > certificates... > > The attached patch fixes this. Also the path[len]='\0' is unnecessary > now that pstrcpy is used. The problem was that the previous strncpy was > called correctly which the r5531 patch didn't think. And due to how the > code is a memcpy could probably be used instead... Thanks for spotting. I made it a qemu_strndup instead because that's basically what's being implemented here (to be exact it could be a memdup() here because the length is already known). Please test. Cheers