From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tdjak-0004h9-CV for qemu-devel@nongnu.org; Wed, 28 Nov 2012 10:30:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Tdjai-0003Kx-Hl for qemu-devel@nongnu.org; Wed, 28 Nov 2012 10:30:26 -0500 Received: from mail-pa0-f45.google.com ([209.85.220.45]:36042) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Tdjai-0003KA-7F for qemu-devel@nongnu.org; Wed, 28 Nov 2012 10:30:24 -0500 Received: by mail-pa0-f45.google.com with SMTP id bg2so6916653pad.4 for ; Wed, 28 Nov 2012 07:30:23 -0800 (PST) Sender: Paolo Bonzini From: Paolo Bonzini Date: Wed, 28 Nov 2012 16:30:03 +0100 Message-Id: <1354116604-32298-2-git-send-email-pbonzini@redhat.com> In-Reply-To: <1354116604-32298-1-git-send-email-pbonzini@redhat.com> References: <1354116604-32298-1-git-send-email-pbonzini@redhat.com> Subject: [Qemu-devel] [PATCH 1/2] nbd: fix use of two uninitialized bytes when connecting to a named export List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com Reported-by: Michal Privoznik Signed-off-by: Paolo Bonzini --- nbd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nbd.c b/nbd.c index 97a5914..01976e8 100644 --- a/nbd.c +++ b/nbd.c @@ -397,6 +397,7 @@ static int nbd_send_negotiate(NBDClient *client) rc = -EINVAL; TRACE("Beginning negotiation."); + memset(buf, 0, sizeof(buf)); memcpy(buf, "NBDMAGIC", 8); if (client->exp) { assert ((client->exp->nbdflags & ~65535) == 0); @@ -406,7 +407,6 @@ static int nbd_send_negotiate(NBDClient *client) } else { cpu_to_be64w((uint64_t*)(buf + 8), NBD_OPTS_MAGIC); } - memset(buf + 28, 0, 124); if (client->exp) { if (write_sync(csock, buf, sizeof(buf)) != sizeof(buf)) { -- 1.8.0