This commit is contained in:
DavidXanatos 2024-06-16 19:04:23 +02:00
parent b49c7fcde1
commit 6a5dec1647
2 changed files with 25 additions and 20 deletions

View File

@ -29,6 +29,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- fixed Chrome stopped printing [#3926](https://github.com/sandboxie-plus/Sandboxie/issues/3926)
- Sandboxie will add CustomChromiumFlags=--disable-features=PrintCompositorLPAC to chrome based browsers command line
- Note: Less Privileged App Container (LPAC) don't work with sandboxie currently
- fixed Problem accessing a relative symlink with a target that starts with a dot [#3981](https://github.com/sandboxie-plus/Sandboxie/issues/3981)

View File

@ -3174,7 +3174,7 @@ WCHAR* File_CanonizePath(const wchar_t* absolute_path, ULONG abs_path_len, const
while(absolute_path[abs_path_len-1] == L'\\')
abs_path_len--;
WCHAR* result = Dll_Alloc((abs_path_len + rel_path_len + 1) * sizeof(wchar_t));
WCHAR* result = (WCHAR*)Dll_Alloc((abs_path_len + rel_path_len + 1) * sizeof(wchar_t));
if (!result) return NULL;
wcsncpy(result, absolute_path, abs_path_len);
result[abs_path_len] = 0;
@ -3192,7 +3192,7 @@ WCHAR* File_CanonizePath(const wchar_t* absolute_path, ULONG abs_path_len, const
i += 3;
} else if (relative_path[i] == L'.') {
} else if (relative_path[i] == L'.' && (relative_path[i + 1] == L'\\' || relative_path[i + 1] == L'\0')) {
i += 2;
@ -3201,13 +3201,17 @@ WCHAR* File_CanonizePath(const wchar_t* absolute_path, ULONG abs_path_len, const
for (j = i; j < rel_path_len && relative_path[j] != L'\\' && relative_path[j] != L'\0'; ++j)
;
if (abs_path_len > 0 && result[abs_path_len - 1] != L'\\') {
result[abs_path_len] = L'\\';
wcsncpy(result + abs_path_len + 1, &relative_path[i], j - i);
result[abs_path_len + j - i + 1] = L'\0';
abs_path_len++;
}
abs_path_len += j - i + 1;
wcsncpy(result + abs_path_len, &relative_path[i], j - i);
result[abs_path_len + j - i] = L'\0';
i = j + 1;
abs_path_len += j - i;
i = j + (relative_path[j] == L'\\' ? 1 : 0);
}
}