diff options
author | Rahul Dadhich <r.dadhich@samsung.com> | 2018-10-05 16:26:50 +0530 |
---|---|---|
committer | Rahul Dadhich <r.dadhich@samsung.com> | 2018-10-11 11:43:11 +0000 |
commit | 7bfe1c79300c7e40ce189070b125e8fb704f2f0c (patch) | |
tree | 6f04d3c2ec9c06fd4bb3b0f5e1f7c57a7c38e8bb | |
parent | 3669652f5db6fa94ad8b996acf1d9bc9245158f6 (diff) | |
download | qemu-7bfe1c79300c7e40ce189070b125e8fb704f2f0c.tar.gz qemu-7bfe1c79300c7e40ce189070b125e8fb704f2f0c.tar.bz2 qemu-7bfe1c79300c7e40ce189070b125e8fb704f2f0c.zip |
Open source Vulnerability fixed
Change-Id: I0a8b15c76ff603044b8bc50005bcc6ac27143d26
Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
-rw-r--r-- | hw/9pfs/9p-local.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/hw/9pfs/9p-local.c b/hw/9pfs/9p-local.c index 845675e7a1..8131aacdd0 100644 --- a/hw/9pfs/9p-local.c +++ b/hw/9pfs/9p-local.c @@ -1061,8 +1061,13 @@ static int local_name_to_path(FsContext *ctx, V9fsPath *dir_path, { if (dir_path) { v9fs_path_sprintf(target, "%s/%s", dir_path->data, name); - } else { + } else if (strcmp(name, "/")) { v9fs_path_sprintf(target, "%s", name); + } else { + /* We want the path of the export root to be relative, otherwise + * "*at()" syscalls would treat it as "/" in the host. + */ + v9fs_path_sprintf(target, "%s", "."); } return 0; } |