From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JzC6N-0002GH-Eo for qemu-devel@nongnu.org; Thu, 22 May 2008 10:49:07 -0400 Received: from [199.232.76.173] (port=40215 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JzC6M-0002G7-3O for qemu-devel@nongnu.org; Thu, 22 May 2008 10:49:06 -0400 Received: from mx1.polytechnique.org ([129.104.30.34]:34275) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1JzC6L-0002F7-N9 for qemu-devel@nongnu.org; Thu, 22 May 2008 10:49:05 -0400 Received: from fbe1.dev.netgem.com (gw.netgem.com [195.68.2.34]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ssl.polytechnique.org (Postfix) with ESMTP id 9568733175 for ; Thu, 22 May 2008 16:49:03 +0200 (CEST) Message-ID: <483587DD.6050502@bellard.org> Date: Thu, 22 May 2008 16:49:01 +0200 From: Fabrice Bellard MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH 1/2] Refactor und fix do_sendkey References: <483571E7.2@web.de> In-Reply-To: <483571E7.2@web.de> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit 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 Please avoid strncpy. Use pstrcpy intead. Fabrice. Jan Kiszka wrote: > Looking at the sendkey implementation, planning to enhance it with a > hold time argument, I found some potential out-of-bound access and not > very readable code. Here is a fix for the former and a (subjective) > improvement of the latter. > [...]