mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[RTL]
Fix a nasty bug in RtlQueryRegistryValues, that caused memory corruption when the the key name or data had the "wrong" length. svn path=/trunk/; revision=61624
This commit is contained in:
parent
af7aa8d819
commit
0caf2dda61
1 changed files with 1 additions and 1 deletions
|
@ -211,7 +211,7 @@ RtlpCallQueryRegistryRoutine(IN PRTL_QUERY_REGISTRY_TABLE QueryTable,
|
|||
|
||||
/* Check if we have space to copy the data */
|
||||
RequiredLength = KeyValueInfo->NameLength + sizeof(UNICODE_NULL);
|
||||
if (SpareLength < RequiredLength)
|
||||
if ((SpareData > DataEnd) || (SpareLength < RequiredLength))
|
||||
{
|
||||
/* Fail and return the missing length */
|
||||
*InfoSize = (ULONG)(SpareData - (PCHAR)KeyValueInfo) + RequiredLength;
|
||||
|
|
Loading…
Reference in a new issue