Author: rharabien
Date: Sat Mar 26 15:12:23 2011
New Revision: 51159
URL:
http://svn.reactos.org/svn/reactos?rev=51159&view=rev
Log:
[NDIS]
Correct Length value in case string is truncated
Modified:
trunk/reactos/drivers/network/ndis/ndis/config.c
Modified: trunk/reactos/drivers/network/ndis/ndis/config.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/ndis/ndis/…
==============================================================================
--- trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/ndis/ndis/config.c [iso-8859-1] Sat Mar 26 15:12:23
2011
@@ -841,7 +841,7 @@
/* should i fail instead if the passed-in string isn't long enough? */
wcsncpy(KeyName->Buffer, KeyInformation->Name,
KeyName->MaximumLength/sizeof(WCHAR));
- KeyName->Length = (USHORT)KeyInformation->NameLength;
+ KeyName->Length = (USHORT)min(KeyInformation->NameLength,
KeyName->MaximumLength);
InitializeObjectAttributes(&KeyAttributes, KeyName, OBJ_CASE_INSENSITIVE,
ConfigurationHandle, NULL);