* dtable.cc (handle_to_fn): Check error return value from NtQueryObject first
before seeing if name buffer is NULL. * grp.cc (read_etc_group): Fix gcc warning regarding snprintf format. * passwd.cc (read_etc_passwd): Ditto.
This commit is contained in:
@@ -734,15 +734,19 @@ handle_to_fn (HANDLE h, char *posix_fn)
|
||||
|
||||
DWORD res = NtQueryObject (h, ObjectNameInformation, ntfn, sizeof (fnbuf), NULL);
|
||||
|
||||
// NT seems to do this on an unopened file
|
||||
if (!ntfn->Name.Buffer)
|
||||
return NULL;
|
||||
|
||||
if (res)
|
||||
{
|
||||
strcpy (posix_fn, "some disk file");
|
||||
return posix_fn;
|
||||
}
|
||||
|
||||
// NT seems to do this on an unopened file
|
||||
if (!ntfn->Name.Buffer)
|
||||
{
|
||||
debug_printf ("nt->Name.Buffer == NULL");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ntfn->Name.Buffer[ntfn->Name.Length / sizeof (WCHAR)] = 0;
|
||||
|
||||
char win32_fn[MAX_PATH + 100];
|
||||
|
Reference in New Issue
Block a user