Author: tfaber
Date: Sat Mar 21 08:25:59 2015
New Revision: 66844
URL:
http://svn.reactos.org/svn/reactos?rev=66844&view=rev
Log:
[NTOS:CM]
- Always fill out KEY_NAME_INFORMATION::NameLength in CmpQueryNameInformation if enough
space is available. Fixes ntdll:reg test failures.
CORE-9403 #resolve
Modified:
trunk/reactos/ntoskrnl/config/cmapi.c
Modified: trunk/reactos/ntoskrnl/config/cmapi.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmapi.c?re…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmapi.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmapi.c [iso-8859-1] Sat Mar 21 08:25:59 2015
@@ -1543,9 +1543,14 @@
_SEH2_TRY
{
- *ResultLength = NeededLength + FIELD_OFFSET(KEY_NAME_INFORMATION, Name[0]);
+ *ResultLength = FIELD_OFFSET(KEY_NAME_INFORMATION, Name) + NeededLength;
+ if (Length < RTL_SIZEOF_THROUGH_FIELD(KEY_NAME_INFORMATION, NameLength))
+ return STATUS_BUFFER_TOO_SMALL;
if (Length < *ResultLength)
- return STATUS_BUFFER_TOO_SMALL;
+ {
+ KeyNameInfo->NameLength = NeededLength;
+ return STATUS_BUFFER_OVERFLOW;
+ }
}
_SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
{