mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 18:15:11 +00:00
Don't always return STATUS_BUFFER_TOO_SMALL when an error occurs in ZwQueryValueKey.
The "if" was triggered because ValueInformation->DataLength is 0xcdcdcdcd at the return of the function svn path=/trunk/; revision=18442
This commit is contained in:
parent
23e3fa1b76
commit
cce498f665
1 changed files with 6 additions and 3 deletions
|
@ -322,15 +322,18 @@ IoGetDeviceProperty(
|
||||||
*ResultLength = ValueInformation->DataLength;
|
*ResultLength = ValueInformation->DataLength;
|
||||||
ZwClose(KeyHandle);
|
ZwClose(KeyHandle);
|
||||||
|
|
||||||
if (ValueInformation->DataLength > BufferLength)
|
|
||||||
Status = STATUS_BUFFER_TOO_SMALL;
|
|
||||||
|
|
||||||
if (!NT_SUCCESS(Status))
|
if (!NT_SUCCESS(Status))
|
||||||
{
|
{
|
||||||
ExFreePool(ValueInformation);
|
ExFreePool(ValueInformation);
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ValueInformation->DataLength > BufferLength)
|
||||||
|
{
|
||||||
|
ExFreePool(ValueInformation);
|
||||||
|
return STATUS_BUFFER_TOO_SMALL;
|
||||||
|
}
|
||||||
|
|
||||||
/* FIXME: Verify the value (NULL-terminated, correct format). */
|
/* FIXME: Verify the value (NULL-terminated, correct format). */
|
||||||
|
|
||||||
RtlCopyMemory(PropertyBuffer, ValueInformation->Data,
|
RtlCopyMemory(PropertyBuffer, ValueInformation->Data,
|
||||||
|
|
Loading…
Reference in a new issue