From cc588808613c638d52a5491962de3eefb2842689 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Bidar?= Date: Fri, 22 Jan 2021 18:11:32 +0200 Subject: [PATCH] [pathmapping] Don't resolve empty path in sbox_map_path_at(). JB#44353 --- scratchbox2/pathmapping/pathmapping_interf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scratchbox2/pathmapping/pathmapping_interf.c b/scratchbox2/pathmapping/pathmapping_interf.c index fdc0c90c..c1c1a622 100644 --- a/scratchbox2/pathmapping/pathmapping_interf.c +++ b/scratchbox2/pathmapping/pathmapping_interf.c @@ -249,6 +249,9 @@ void sbox_map_path_at( res->mres_readonly = 1; return; } + if (*virtual_path == '\0') { + goto end; + } if ((*virtual_path == '/') #ifdef AT_FDCWD @@ -287,6 +290,7 @@ void sbox_map_path_at( return; } +end: /* name not found. Can't do much here, log a warning and return * the original relative path. That will work if we are lucky, but * not always.. */