From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:46110) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwctZ-0001QT-7f for qemu-devel@nongnu.org; Thu, 25 Aug 2011 12:35:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwctT-0002n5-7n for qemu-devel@nongnu.org; Thu, 25 Aug 2011 12:35:09 -0400 Received: from e23smtp08.au.ibm.com ([202.81.31.141]:44697) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwctS-0002lh-Ky for qemu-devel@nongnu.org; Thu, 25 Aug 2011 12:35:03 -0400 Received: from d23relay04.au.ibm.com (d23relay04.au.ibm.com [202.81.31.246]) by e23smtp08.au.ibm.com (8.14.4/8.13.1) with ESMTP id p7PGTdsw011558 for ; Fri, 26 Aug 2011 02:29:39 +1000 Received: from d23av02.au.ibm.com (d23av02.au.ibm.com [9.190.235.138]) by d23relay04.au.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id p7PGXPN21388794 for ; Fri, 26 Aug 2011 02:33:30 +1000 Received: from d23av02.au.ibm.com (loopback [127.0.0.1]) by d23av02.au.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id p7PGYhnv025015 for ; Fri, 26 Aug 2011 02:34:43 +1000 From: "Aneesh Kumar K.V" Date: Thu, 25 Aug 2011 22:03:49 +0530 Message-Id: <1314290029-20290-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH] hw/9pfs: Initialize rest of qid field to zero. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@us.ibm.com, "Aneesh Kumar K.V" Since qid is allocated out of stack we need to intialize the field to zero. Otherwise we will send wrong qid value to client. Signed-off-by: Aneesh Kumar K.V --- hw/9pfs/virtio-9p.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/hw/9pfs/virtio-9p.c b/hw/9pfs/virtio-9p.c index 6b275a5..e70d8f6 100644 --- a/hw/9pfs/virtio-9p.c +++ b/hw/9pfs/virtio-9p.c @@ -543,6 +543,7 @@ static void stat_to_qid(const struct stat *stbuf, V9fsQID *qidp) { size_t size; + memset(&qidp->path, 0, sizeof(qidp->path)); size = MIN(sizeof(stbuf->st_ino), sizeof(qidp->path)); memcpy(&qidp->path, &stbuf->st_ino, size); qidp->version = stbuf->st_mtime ^ (stbuf->st_size << 8); -- 1.7.4.1