Received: from eggs.gnu.org ([140.186.70.92]:48774) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDJw5-0000Ei-CK for qemu-devel@nongnu.org; Mon, 10 Oct 2011 13:46:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RDJw4-0004Ij-FZ for qemu-devel@nongnu.org; Mon, 10 Oct 2011 13:46:45 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39867) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RDJw4-0004Id-6e for qemu-devel@nongnu.org; Mon, 10 Oct 2011 13:46:44 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9AHkh3p021618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 10 Oct 2011 13:46:43 -0400 From: Kevin Wolf Date: Mon, 10 Oct 2011 19:49:46 +0200 Message-Id: <1318268986-31010-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH] vvfat: Fix potential buffer overflow List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com path2[PATH_MAX] can be used for the null termination, so make the array big enough to allow this. Signed-off-by: Kevin Wolf --- block/vvfat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index ba207e2..7e9e35a 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1690,7 +1690,7 @@ static int check_directory_consistency(BDRVVVFATState *s, long_file_name lfn; int path_len = strlen(path); - char path2[PATH_MAX]; + char path2[PATH_MAX + 1]; assert(path_len < PATH_MAX); /* len was tested before! */ pstrcpy(path2, sizeof(path2), path); -- 1.7.6.4