ntdll: Extra check for ObjectAttributes (Coverity).
This commit is contained in:
parent
909b6c0dc0
commit
cbf9fde47a
|
@ -562,7 +562,7 @@ NTSTATUS WINAPI NtCreateSymbolicLinkObject(OUT PHANDLE SymbolicLinkHandle,IN ACC
|
|||
req->access = DesiredAccess;
|
||||
req->attributes = ObjectAttributes ? ObjectAttributes->Attributes : 0;
|
||||
req->rootdir = ObjectAttributes ? ObjectAttributes->RootDirectory : 0;
|
||||
if (ObjectAttributes->ObjectName)
|
||||
if (ObjectAttributes && ObjectAttributes->ObjectName)
|
||||
{
|
||||
req->name_len = ObjectAttributes->ObjectName->Length;
|
||||
wine_server_add_data(req, ObjectAttributes->ObjectName->Buffer,
|
||||
|
|
|
@ -483,6 +483,13 @@ void test_symboliclink(void)
|
|||
ok(status == STATUS_INVALID_PARAMETER,
|
||||
"NtOpenSymbolicLinkObject should have failed with STATUS_INVALID_PARAMETER got(%08x)\n", status);
|
||||
|
||||
/* No attributes */
|
||||
pRtlCreateUnicodeStringFromAsciiz(&target, "\\DosDevices");
|
||||
status = pNtCreateSymbolicLinkObject(&h, SYMBOLIC_LINK_QUERY, NULL, &target);
|
||||
ok(status == STATUS_SUCCESS, "NtCreateSymbolicLinkObject failed(%08x)\n", status);
|
||||
pRtlFreeUnicodeString(&target);
|
||||
pNtClose(h);
|
||||
|
||||
InitializeObjectAttributes(&attr, NULL, 0, 0, NULL);
|
||||
SYMLNK_TEST_CREATE_FAILURE(&link, STATUS_INVALID_PARAMETER)
|
||||
SYMLNK_TEST_OPEN_FAILURE(&h, STATUS_OBJECT_PATH_SYNTAX_BAD)
|
||||
|
|
Loading…
Reference in New Issue