mirror of
https://github.com/reactos/reactos.git
synced 2025-06-12 01:48:31 +00:00
[NTOSKRNL] Fix a nullptr dereference in IopStartDevice
This commit is contained in:
parent
10c5bfb8fe
commit
b2b1c054e4
1 changed files with 5 additions and 2 deletions
|
@ -786,7 +786,7 @@ IopStartDevice(
|
||||||
{
|
{
|
||||||
NTSTATUS Status;
|
NTSTATUS Status;
|
||||||
HANDLE InstanceHandle = NULL, ControlHandle = NULL;
|
HANDLE InstanceHandle = NULL, ControlHandle = NULL;
|
||||||
UNICODE_STRING KeyName;
|
UNICODE_STRING KeyName, ValueString;
|
||||||
OBJECT_ATTRIBUTES ObjectAttributes;
|
OBJECT_ATTRIBUTES ObjectAttributes;
|
||||||
|
|
||||||
if (DeviceNode->Flags & DNF_DISABLED)
|
if (DeviceNode->Flags & DNF_DISABLED)
|
||||||
|
@ -817,7 +817,10 @@ IopStartDevice(
|
||||||
goto ByeBye;
|
goto ByeBye;
|
||||||
|
|
||||||
RtlInitUnicodeString(&KeyName, L"ActiveService");
|
RtlInitUnicodeString(&KeyName, L"ActiveService");
|
||||||
Status = ZwSetValueKey(ControlHandle, &KeyName, 0, REG_SZ, DeviceNode->ServiceName.Buffer, DeviceNode->ServiceName.Length + sizeof(UNICODE_NULL));
|
ValueString = DeviceNode->ServiceName;
|
||||||
|
if (!ValueString.Buffer)
|
||||||
|
RtlInitUnicodeString(&ValueString, L"");
|
||||||
|
Status = ZwSetValueKey(ControlHandle, &KeyName, 0, REG_SZ, ValueString.Buffer, ValueString.Length + sizeof(UNICODE_NULL));
|
||||||
// }
|
// }
|
||||||
|
|
||||||
ByeBye:
|
ByeBye:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue