From 7e914b6e08da7c67d256912621153c3d7d5f23af Mon Sep 17 00:00:00 2001 From: Rafal Harabien Date: Sat, 26 Mar 2011 15:12:23 +0000 Subject: [PATCH] [NDIS] Correct Length value in case string is truncated svn path=/trunk/; revision=51159 --- reactos/drivers/network/ndis/ndis/config.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reactos/drivers/network/ndis/ndis/config.c b/reactos/drivers/network/ndis/ndis/config.c index b95f1e01060..f0227c71fd6 100644 --- a/reactos/drivers/network/ndis/ndis/config.c +++ b/reactos/drivers/network/ndis/ndis/config.c @@ -841,7 +841,7 @@ NdisOpenConfigurationKeyByIndex( /* 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); -- 2.17.1