From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:39960) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SCsMx-0005Kw-9n for qemu-devel@nongnu.org; Wed, 28 Mar 2012 08:53:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SCsMq-0007pC-E9 for qemu-devel@nongnu.org; Wed, 28 Mar 2012 08:52:54 -0400 From: =?UTF-8?q?Andreas=20F=C3=A4rber?= Date: Wed, 28 Mar 2012 14:52:19 +0200 Message-Id: <1332939159-16434-17-git-send-email-afaerber@suse.de> In-Reply-To: <1332939159-16434-1-git-send-email-afaerber@suse.de> References: <1332939159-16434-1-git-send-email-afaerber@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH stable-0.15 16/36] vvfat: Fix potential buffer overflow List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Kevin Wolf , kvm@suse.de, qemu-stable@nongnu.org, =?UTF-8?q?Andreas=20F=C3=A4rber?= , Bruce Rogers From: Kevin Wolf path2[PATH_MAX] can be used for the null termination, so make the array b= ig enough to allow this. Signed-off-by: Kevin Wolf (cherry picked from commit 0d460d6f414e02805cbc348404db03b2b7907360) Signed-off-by: Bruce Rogers Signed-off-by: Andreas F=C3=A4rber --- block/vvfat.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/block/vvfat.c b/block/vvfat.c index fe568fe..98b58f0 100644 --- a/block/vvfat.c +++ b/block/vvfat.c @@ -1741,7 +1741,7 @@ static int check_directory_consistency(BDRVVVFATSta= te *s, =20 long_file_name lfn; int path_len =3D strlen(path); - char path2[PATH_MAX]; + char path2[PATH_MAX + 1]; =20 assert(path_len < PATH_MAX); /* len was tested before! */ pstrcpy(path2, sizeof(path2), path); --=20 1.7.7