From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Khmmo-00055O-2a for qemu-devel@nongnu.org; Mon, 22 Sep 2008 10:53:14 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Khmml-00054o-Jo for qemu-devel@nongnu.org; Mon, 22 Sep 2008 10:53:12 -0400 Received: from [199.232.76.173] (port=58149 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Khmml-00054l-EW for qemu-devel@nongnu.org; Mon, 22 Sep 2008 10:53:11 -0400 Received: from ecfrec.frec.bull.fr ([129.183.4.8]:58037) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Khmmk-0000QW-Um for qemu-devel@nongnu.org; Mon, 22 Sep 2008 10:53:11 -0400 Received: from localhost (localhost [127.0.0.1]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id 791731A195C for ; Mon, 22 Sep 2008 16:52:29 +0200 (CEST) Received: from ecfrec.frec.bull.fr ([127.0.0.1]) by localhost (ecfrec.frec.bull.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 06605-03 for ; Mon, 22 Sep 2008 16:52:26 +0200 (CEST) Received: from cyclope.frec.bull.fr (cyclope.frec.bull.fr [129.183.4.9]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id A53ED1A1959 for ; Mon, 22 Sep 2008 16:52:26 +0200 (CEST) Received: from [129.183.101.63] (frecb007144.frec.bull.fr [129.183.101.63]) by cyclope.frec.bull.fr (Postfix) with ESMTP id D0D1C2728D for ; Mon, 22 Sep 2008 16:52:23 +0200 (CEST) From: Laurent Vivier Content-Type: text/plain Date: Mon, 22 Sep 2008 16:52:32 +0200 Message-Id: <1222095152.4151.6.camel@frecb07144> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [Qemu-devel] [PATCH] scsi-generic: correct usage of memset(). 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" void *memset(void *s, int c, size_t n); DESCRIPTION The memset() function fills the first n bytes of the memory area pointed to by s with the constant byte c." Reported by Dietmar Maurer. Signed-off-by: Laurent Vivier --- hw/scsi-generic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) Index: qemu/hw/scsi-generic.c =================================================================== --- qemu.orig/hw/scsi-generic.c 2008-09-22 10:46:42.000000000 +0200 +++ qemu/hw/scsi-generic.c 2008-09-22 14:32:26.000000000 +0200 @@ -548,8 +548,8 @@ static int get_blocksize(BlockDriverStat sg_io_hdr_t io_header; int ret; - memset(cmd, sizeof(cmd), 0); - memset(buf, sizeof(buf), 0); + memset(cmd, 0, sizeof(cmd)); + memset(buf, 0, sizeof(buf)); cmd[0] = READ_CAPACITY; memset(&io_header, 0, sizeof(io_header));