[ros-diffs] [rharabien] 51159: [NDIS] Correct Length value in case string is truncated

rharabien at svn.reactos.org rharabien at svn.reactos.org
Sat Mar 26 15:12:23 UTC 2011


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/config.c?rev=51159&r1=51158&r2=51159&view=diff
==============================================================================
--- 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);
 




More information about the Ros-diffs mailing list