mirror of https://github.com/xemu-project/xemu.git
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 <kwolf@redhat.com>
This commit is contained in:
parent
7ef6d3dc39
commit
0d460d6f41
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue