From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:58838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REku5-0006Cc-AK for qemu-devel@nongnu.org; Fri, 14 Oct 2011 12:46:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1REku4-0001Dk-38 for qemu-devel@nongnu.org; Fri, 14 Oct 2011 12:46:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:29756) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1REku3-0001Dc-QG for qemu-devel@nongnu.org; Fri, 14 Oct 2011 12:46:36 -0400 From: Kevin Wolf Date: Fri, 14 Oct 2011 18:49:06 +0200 Message-Id: <1318610959-17971-12-git-send-email-kwolf@redhat.com> In-Reply-To: <1318610959-17971-1-git-send-email-kwolf@redhat.com> References: <1318610959-17971-1-git-send-email-kwolf@redhat.com> Subject: [Qemu-devel] [PATCH 11/24] vvfat: Fix potential buffer overflow List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: kwolf@redhat.com, qemu-devel@nongnu.org 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