From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mtgxh-0001Ik-F5 for qemu-devel@nongnu.org; Fri, 02 Oct 2009 08:10:13 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mtgxc-0001IK-B2 for qemu-devel@nongnu.org; Fri, 02 Oct 2009 08:10:12 -0400 Received: from [199.232.76.173] (port=44421 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mtgxc-0001IG-6X for qemu-devel@nongnu.org; Fri, 02 Oct 2009 08:10:08 -0400 Received: from smtp-out2.tiscali.nl ([195.241.79.177]:40085) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Mtgxb-0002cD-MX for qemu-devel@nongnu.org; Fri, 02 Oct 2009 08:10:07 -0400 Received: from [212.123.169.34] (helo=[192.168.1.61]) by smtp-out2.tiscali.nl with esmtp (Exim) (envelope-from ) id 1Mtgxa-0002Rr-DL for qemu-devel@nongnu.org; Fri, 02 Oct 2009 14:10:06 +0200 From: Paul Bolle Content-Type: text/plain; charset="UTF-8" Date: Fri, 02 Oct 2009 14:10:04 +0200 Message-Id: <1254485404.1738.14.camel@localhost.localdomain> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] linux-user: don't zero a buffer twice List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org prepare_binprm() zeroes bprm->buf. That buffer is already zeroed in main() and hasn't been touched since so that is not necessary. Signed-off-by: Paul Bolle --- Just a minor issue that I noticed while reading the code for some other reason. bsd-user/bsdload.c could need a similar patch. I haven't looked at that yet. linux-user/linuxload.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/linux-user/linuxload.c b/linux-user/linuxload.c index 4091bdc..2d778a2 100644 --- a/linux-user/linuxload.c +++ b/linux-user/linuxload.c @@ -96,7 +96,6 @@ static int prepare_binprm(struct linux_binprm *bprm) } } - memset(bprm->buf, 0, sizeof(bprm->buf)); retval = lseek(bprm->fd, 0L, SEEK_SET); if(retval >= 0) { retval = read(bprm->fd, bprm->buf, 128); -- 1.6.5.rc2