[NTOS:CM] Add extra validation for the information class parameter in NtEnumerateValueKey().

This commit is contained in:
Hermès Bélusca-Maïto 2018-10-21 18:12:08 +02:00
parent 49e08b23ce
commit 16752875db
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0

View file

@ -551,14 +551,18 @@ NtEnumerateValueKey(IN HANDLE KeyHandle,
PCM_KEY_BODY KeyObject;
REG_ENUMERATE_VALUE_KEY_INFORMATION EnumerateValueKeyInfo;
REG_POST_OPERATION_INFORMATION PostOperationInfo;
PAGED_CODE();
DPRINT("NtEnumerateValueKey() KH 0x%p, Index 0x%x, KVIC %d, Length %lu\n",
KeyHandle, Index, KeyValueInformationClass, Length);
/* Reject classes we don't know about */
if ((KeyValueInformationClass != KeyValueBasicInformation) &&
(KeyValueInformationClass != KeyValueFullInformation) &&
(KeyValueInformationClass != KeyValuePartialInformation))
if ((KeyValueInformationClass != KeyValueBasicInformation) &&
(KeyValueInformationClass != KeyValueFullInformation) &&
(KeyValueInformationClass != KeyValuePartialInformation) &&
(KeyValueInformationClass != KeyValueFullInformationAlign64) &&
(KeyValueInformationClass != KeyValuePartialInformationAlign64))
{
/* Fail */
return STATUS_INVALID_PARAMETER;