From 54867f2910ca7d860a628a85f8f59b677e64d0a7 Mon Sep 17 00:00:00 2001 From: Hartmut Birr Date: Mon, 25 Aug 2003 18:24:20 +0000 Subject: [PATCH] - Fixed a buffer overflow. svn path=/trunk/; revision=5855 --- reactos/drivers/net/ndis/ndis/protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/net/ndis/ndis/protocol.c b/reactos/drivers/net/ndis/ndis/protocol.c index d1818579469..69ef0b762e1 100644 --- a/reactos/drivers/net/ndis/ndis/protocol.c +++ b/reactos/drivers/net/ndis/ndis/protocol.c @@ -714,9 +714,9 @@ NdisRegisterProtocol( wcscpy(RegistryPathStr, SERVICES_KEY); wcscat(RegistryPathStr, (((WCHAR *)(KeyInformation->Data)) +8 )); wcscat(RegistryPathStr, PARAMETERS_KEY); - wcsncat(RegistryPathStr, ProtocolCharacteristics->Name.Buffer, ProtocolCharacteristics->Name.Length); + wcsncat(RegistryPathStr, ProtocolCharacteristics->Name.Buffer, ProtocolCharacteristics->Name.Length / sizeof(WCHAR) ); - RegistryPathStr[PathLength/sizeof(WCHAR)] = 0; + RegistryPathStr[PathLength/sizeof(WCHAR) - 1] = 0; RtlInitUnicodeString(&RegistryPath, RegistryPathStr);