Don't go further than end of string when writing value to registry

svn path=/trunk/; revision=24166
This commit is contained in:
Hervé Poussineau
2006-09-17 12:20:44 +00:00
parent f271868696
commit ac233d6e61
+2 -2
View File
@@ -2841,7 +2841,7 @@ IopEnumerateDetectedDevices(
ZwDeleteKey(hLevel2Key);
goto nextdevice;
}
Status = ZwSetValueKey(hLevel2Key, &HardwareIDU, 0, REG_MULTI_SZ, pHardwareId->Buffer, pHardwareId->MaximumLength + sizeof(WCHAR));
Status = ZwSetValueKey(hLevel2Key, &HardwareIDU, 0, REG_MULTI_SZ, pHardwareId->Buffer, pHardwareId->MaximumLength);
if (!NT_SUCCESS(Status))
{
DPRINT("ZwSetValueKey() failed with status 0x%08lx\n", Status);
@@ -3107,7 +3107,7 @@ IopUpdateRootKey(VOID)
return Status;
Status = ZwSetValueKey(hHalAcpiId, &DeviceDescU, 0, REG_SZ, HalAcpiDeviceDesc.Buffer, HalAcpiDeviceDesc.MaximumLength);
if (NT_SUCCESS(Status))
Status = ZwSetValueKey(hHalAcpiId, &HardwareIDU, 0, REG_MULTI_SZ, HalAcpiHardwareID.Buffer, HalAcpiHardwareID.MaximumLength + sizeof(WCHAR));
Status = ZwSetValueKey(hHalAcpiId, &HardwareIDU, 0, REG_MULTI_SZ, HalAcpiHardwareID.Buffer, HalAcpiHardwareID.MaximumLength);
ZwClose(hHalAcpiId);
return Status;
}