From f902184fa8aa37b0ce8b725da5657ef2ed2005dd Mon Sep 17 00:00:00 2001 From: Ron Yorston Date: Sat, 12 Dec 2020 13:23:38 +0000 Subject: win32: make realpath() return an error if necessary resolve_symlinks() uses GetFinalPathNameByHandleA which is loaded at runtime because it isn't available in all versions of Windows. If GetFinalPathNameByHandleA isn't available resolve_symlinks() (and hence realpath()) should return a NULL pointer to indicate an error, not the original path. Not returning NULL causes an infinite loop in do_lstat(). See GitHub issue #204. --- win32/mingw.c | 1 - 1 file changed, 1 deletion(-) diff --git a/win32/mingw.c b/win32/mingw.c index 75f15aa30..ed0989be2 100644 --- a/win32/mingw.c +++ b/win32/mingw.c @@ -1088,7 +1088,6 @@ static char *resolve_symlinks(char *path) FILE_FLAG_BACKUP_SEMANTICS, NULL); if (h != INVALID_HANDLE_VALUE) { if (!INIT_PROC_ADDR(kernel32.dll, GetFinalPathNameByHandleA)) { - ptr = path; goto end; } -- cgit v1.2.3-55-g6feb