summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRahul Dadhich <r.dadhich@samsung.com>2018-10-05 16:26:50 +0530
committerRahul Dadhich <r.dadhich@samsung.com>2018-10-05 16:26:50 +0530
commit36a0af4eb630bb8c2347f4d1237068548efe0805 (patch)
tree6210c6e7310ab2765af03d3b865519c65db57b0d
parent2dd1ae0c02be3c83d18de18d8403153eceae0100 (diff)
downloadqemu-36a0af4eb630bb8c2347f4d1237068548efe0805.tar.gz
qemu-36a0af4eb630bb8c2347f4d1237068548efe0805.tar.bz2
qemu-36a0af4eb630bb8c2347f4d1237068548efe0805.zip
Open source Vulnerability fixed
Change-Id: I0a8b15c76ff603044b8bc50005bcc6ac27143d26 Signed-off-by: Rahul Dadhich <r.dadhich@samsung.com>
-rw-r--r--hw/9pfs/9p-local.c7
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;
}