[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; PCM_KEY_BODY KeyObject;
REG_ENUMERATE_VALUE_KEY_INFORMATION EnumerateValueKeyInfo; REG_ENUMERATE_VALUE_KEY_INFORMATION EnumerateValueKeyInfo;
REG_POST_OPERATION_INFORMATION PostOperationInfo; REG_POST_OPERATION_INFORMATION PostOperationInfo;
PAGED_CODE(); PAGED_CODE();
DPRINT("NtEnumerateValueKey() KH 0x%p, Index 0x%x, KVIC %d, Length %lu\n", DPRINT("NtEnumerateValueKey() KH 0x%p, Index 0x%x, KVIC %d, Length %lu\n",
KeyHandle, Index, KeyValueInformationClass, Length); KeyHandle, Index, KeyValueInformationClass, Length);
/* Reject classes we don't know about */ /* Reject classes we don't know about */
if ((KeyValueInformationClass != KeyValueBasicInformation) && if ((KeyValueInformationClass != KeyValueBasicInformation) &&
(KeyValueInformationClass != KeyValueFullInformation) && (KeyValueInformationClass != KeyValueFullInformation) &&
(KeyValueInformationClass != KeyValuePartialInformation)) (KeyValueInformationClass != KeyValuePartialInformation) &&
(KeyValueInformationClass != KeyValueFullInformationAlign64) &&
(KeyValueInformationClass != KeyValuePartialInformationAlign64))
{ {
/* Fail */ /* Fail */
return STATUS_INVALID_PARAMETER; return STATUS_INVALID_PARAMETER;