mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[KERNEL32] RemoveDirectoryW: Fix the code for removing a mounted folder (#7897)
- Fix the crash due to copying the memory to wrong destination buffer. - Fix the check for trailing backlash on path string.
This commit is contained in:
@@ -919,8 +919,8 @@ RemoveDirectoryW(IN LPCWSTR lpPathName)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
RtlCopyMemory(&PathName.Buffer, lpPathName, PathName.Length);
|
||||
if (PathName.Buffer[PathName.Length / sizeof(WCHAR)] != L'\\')
|
||||
RtlCopyMemory(PathName.Buffer, lpPathName, PathName.Length);
|
||||
if (PathName.Buffer[(PathName.Length / sizeof(WCHAR)) - 1] != L'\\')
|
||||
{
|
||||
PathName.Buffer[PathName.Length / sizeof(WCHAR)] = L'\\';
|
||||
PathName.Buffer[(PathName.Length / sizeof(WCHAR)) + 1] = UNICODE_NULL;
|
||||
|
||||
Reference in New Issue
Block a user