* path.cc (path_conv::get_nt_native_path): Avoid dereferencing path when it is

NULL.
This commit is contained in:
Christopher Faylor
2011-10-23 17:19:17 +00:00
parent 6ae28c2263
commit 1f012519e4
2 changed files with 17 additions and 2 deletions

View File

@ -450,15 +450,21 @@ get_nt_native_path (const char *path, UNICODE_STRING& upath, bool dos)
PUNICODE_STRING
path_conv::get_nt_native_path ()
{
if (!wide_path)
PUNICODE_STRING res;
if (wide_path)
res = &uni_path;
else if (!path)
res = NULL;
else
{
uni_path.Length = 0;
uni_path.MaximumLength = (strlen (path) + 10) * sizeof (WCHAR);
wide_path = (PWCHAR) cmalloc_abort (HEAP_STR, uni_path.MaximumLength);
uni_path.Buffer = wide_path;
::get_nt_native_path (path, uni_path, has_dos_filenames_only ());
res = &uni_path;
}
return &uni_path;
return res;
}
PWCHAR