diff --git a/src/dll/fsop.c b/src/dll/fsop.c index bfb3517c..66d5b787 100644 --- a/src/dll/fsop.c +++ b/src/dll/fsop.c @@ -1181,14 +1181,14 @@ FSP_API NTSTATUS FspFileSystemResolveReparsePoints(FSP_FILE_SYSTEM *FileSystem, ReparseTargetPathLength >= sizeof(WCHAR) && L'\\' == ReparseTargetPath[0]) goto reparse_data_exit; + if (0 == --MaxTries) + return STATUS_REPARSE_POINT_NOT_RESOLVED; + /* if device relative symlink replace whole path; else replace last path component */ NewRemainderPath = ReparseTargetPathLength >= sizeof(WCHAR) && L'\\' == ReparseTargetPath[0] ? TargetPath : LastPathComponent; reparse: - if (0 == --MaxTries) - return STATUS_REPARSE_POINT_NOT_RESOLVED; - RemainderPathSize = (lstrlenW(RemainderPath) + 1) * sizeof(WCHAR); if (NewRemainderPath + (ReparseTargetPathLength + RemainderPathSize) / sizeof(WCHAR) > TargetPath + *PSize / sizeof(WCHAR)) diff --git a/tst/winfsp-tests/reparse-test.c b/tst/winfsp-tests/reparse-test.c index 68a277dd..0c136167 100644 --- a/tst/winfsp-tests/reparse-test.c +++ b/tst/winfsp-tests/reparse-test.c @@ -444,7 +444,7 @@ static void reparse_symlink_relative_dotest(ULONG Flags, PWSTR Prefix, ULONG Fil my_symlink(L"\\loop", L"loop"); my_symlink(L"\\1\\1.1\\l1.1.1", L"1.1.1"); my_symlinkd(L"\\2\\l1", L"..\\1"); - my_symlinkd(L"\\1\\l2", L"..\\2"); + my_symlinkd(L"\\1\\l2", L"..\\.\\2"); my_symlinkd(L"\\2\\a1", L"\\1"); my_symlinkd(L"\\1\\a2", L"\\2");