mirror of
https://github.com/reactos/reactos.git
synced 2025-07-31 13:51:55 +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:
parent
3d9b919814
commit
016c5fd083
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue