Only return strings from heap, never stack. Fixes access to "/"

This commit is contained in:
Maschell 2022-03-03 19:14:18 +01:00
parent c0f4ed1863
commit b8db1ca6a9

View File

@ -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;
}