Skip to content

Commit 5eb9050

Browse files
Normalize library paths queried from the OS
The path the operating system returns may not be normalized, so comparing it with a normalized path yields false positives.
1 parent 9a8d188 commit 5eb9050

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

loader/loader.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,12 @@ VkResult fixup_library_binary_path(const struct loader_instance *inst, char **li
633633
}
634634

635635
if (NULL != os_determined_lib_name) {
636+
// Normalize the path so that the comparison doesn't yield false positives
637+
res = normalize_path(inst, &os_determined_lib_name);
638+
if (res == VK_ERROR_OUT_OF_HOST_MEMORY) {
639+
return res;
640+
}
641+
636642
if (0 != strcmp(os_determined_lib_name, *lib_name)) {
637643
// Paths do not match, so we need to replace lib_name with the real path
638644
if (!system_path) {

0 commit comments

Comments
 (0)