mirror of
https://github.com/reactos/reactos.git
synced 2025-08-05 06:43:01 +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;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
RtlCopyMemory(&PathName.Buffer, lpPathName, PathName.Length);
|
RtlCopyMemory(PathName.Buffer, lpPathName, PathName.Length);
|
||||||
if (PathName.Buffer[PathName.Length / sizeof(WCHAR)] != L'\\')
|
if (PathName.Buffer[(PathName.Length / sizeof(WCHAR)) - 1] != L'\\')
|
||||||
{
|
{
|
||||||
PathName.Buffer[PathName.Length / sizeof(WCHAR)] = L'\\';
|
PathName.Buffer[PathName.Length / sizeof(WCHAR)] = L'\\';
|
||||||
PathName.Buffer[(PathName.Length / sizeof(WCHAR)) + 1] = UNICODE_NULL;
|
PathName.Buffer[(PathName.Length / sizeof(WCHAR)) + 1] = UNICODE_NULL;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue