mirror of
https://github.com/reactos/wine.git
synced 2024-11-26 05:00:30 +00:00
ntdll: Check for NULL attr in NtOpenKey (Coverity).
This commit is contained in:
parent
6feb525bc7
commit
afd4aed5fc
@ -114,8 +114,10 @@ NTSTATUS WINAPI RtlpNtCreateKey( PHANDLE retkey, ACCESS_MASK access, const OBJEC
|
|||||||
NTSTATUS WINAPI NtOpenKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr )
|
NTSTATUS WINAPI NtOpenKey( PHANDLE retkey, ACCESS_MASK access, const OBJECT_ATTRIBUTES *attr )
|
||||||
{
|
{
|
||||||
NTSTATUS ret;
|
NTSTATUS ret;
|
||||||
DWORD len = attr->ObjectName->Length;
|
DWORD len;
|
||||||
|
|
||||||
|
if (!attr) return STATUS_ACCESS_VIOLATION;
|
||||||
|
len = attr->ObjectName->Length;
|
||||||
TRACE( "(%p,%s,%x,%p)\n", attr->RootDirectory,
|
TRACE( "(%p,%s,%x,%p)\n", attr->RootDirectory,
|
||||||
debugstr_us(attr->ObjectName), access, retkey );
|
debugstr_us(attr->ObjectName), access, retkey );
|
||||||
|
|
||||||
|
@ -336,9 +336,6 @@ static void test_NtOpenKey(void)
|
|||||||
OBJECT_ATTRIBUTES attr;
|
OBJECT_ATTRIBUTES attr;
|
||||||
ACCESS_MASK am = KEY_READ;
|
ACCESS_MASK am = KEY_READ;
|
||||||
|
|
||||||
if (0)
|
|
||||||
{
|
|
||||||
/* Crashes Wine */
|
|
||||||
/* All NULL */
|
/* All NULL */
|
||||||
status = pNtOpenKey(NULL, 0, NULL);
|
status = pNtOpenKey(NULL, 0, NULL);
|
||||||
ok(status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got: 0x%08x\n", status);
|
ok(status == STATUS_ACCESS_VIOLATION, "Expected STATUS_ACCESS_VIOLATION, got: 0x%08x\n", status);
|
||||||
@ -347,7 +344,6 @@ static void test_NtOpenKey(void)
|
|||||||
status = pNtOpenKey(&key, 0, NULL);
|
status = pNtOpenKey(&key, 0, NULL);
|
||||||
ok(status == STATUS_ACCESS_VIOLATION /* W2K3/XP/W2K */ || status == STATUS_INVALID_PARAMETER /* NT4 */,
|
ok(status == STATUS_ACCESS_VIOLATION /* W2K3/XP/W2K */ || status == STATUS_INVALID_PARAMETER /* NT4 */,
|
||||||
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_PARAMETER(NT4), got: 0x%08x\n", status);
|
"Expected STATUS_ACCESS_VIOLATION or STATUS_INVALID_PARAMETER(NT4), got: 0x%08x\n", status);
|
||||||
}
|
|
||||||
|
|
||||||
InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0);
|
InitializeObjectAttributes(&attr, &winetestpath, 0, 0, 0);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user