mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
Fix crashing browsing namespace with non-zero-terminated UNICODE_STRING.
svn path=/trunk/; revision=13177
This commit is contained in:
parent
be2cf1c579
commit
53ea2da74d
1 changed files with 10 additions and 0 deletions
|
@ -227,6 +227,16 @@ void NtObjDirectory::read_directory(int scan_flags)
|
|||
memset(&w32fd, 0, sizeof(WIN32_FIND_DATA));
|
||||
|
||||
#ifdef UNICODE
|
||||
if (info->name.string_ptr) {
|
||||
info->name.string_ptr[info->name.string_len / sizeof(WCHAR)] = 0;
|
||||
} else {
|
||||
info->name.string_ptr = TEXT("");
|
||||
}
|
||||
if (info->type.string_ptr) {
|
||||
info->type.string_ptr[info->type.string_len / sizeof(WCHAR)] = 0;
|
||||
} else {
|
||||
info->type.string_ptr = TEXT("");
|
||||
}
|
||||
wcscpyn(p, info->name.string_ptr, _MAX_PATH);
|
||||
#else
|
||||
WideCharToMultiByte(CP_ACP, 0, info->name.string_ptr, info->name.string_len, p, MAX_PATH, 0, 0);
|
||||
|
|
Loading…
Reference in a new issue