[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] vvfat: Fix potential buffer overflow
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH] vvfat: Fix potential buffer overflow |
Date: |
Mon, 10 Oct 2011 19:49:46 +0200 |
path2[PATH_MAX] can be used for the null termination, so make the array big
enough to allow this.
Signed-off-by: Kevin Wolf <address@hidden>
---
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
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Qemu-devel] [PATCH] vvfat: Fix potential buffer overflow,
Kevin Wolf <=