From 0d460d6f414e02805cbc348404db03b2b7907360 Mon Sep 17 00:00:00 2001 From: Kevin Wolf Date: Wed, 1 Jun 2011 10:57:00 +0200 Subject: vvfat: Fix potential buffer overflow 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 file changed, 1 insertion(+), 1 deletion(-) 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); -- cgit v1.1