From b8db1ca6a9a6ad584edf2c5b26762d65533a0345 Mon Sep 17 00:00:00 2001 From: Maschell Date: Thu, 3 Mar 2022 19:14:18 +0100 Subject: [PATCH] Only return strings from heap, never stack. Fixes access to "/" --- src/vrt.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vrt.c b/src/vrt.c index 4664ee0..0de71cd 100644 --- a/src/vrt.c +++ b/src/vrt.c @@ -127,7 +127,10 @@ char *to_real_path(char *virtual_cwd, char *virtual_path) { if (!strcmp("/", virtual_path)) { // indicate vfs-root with "" - path = ""; + path = malloc(1); + if (path) { + path[0] = 0; + } goto end; }