From 10b13ed7c9e2ee9108f628331eb9a85e2ea8cc15 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Wed, 12 Aug 2009 23:14:49 +0000 Subject: [PATCH] - Don't access an uninitialized variable - Initialize the unicode string at the start of the function - Spotted by Amine Khaldi svn path=/trunk/; revision=42642 --- reactos/drivers/network/tcpip/datalink/lan.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/drivers/network/tcpip/datalink/lan.c b/reactos/drivers/network/tcpip/datalink/lan.c index b550d20d258..b77aaf888d6 100644 --- a/reactos/drivers/network/tcpip/datalink/lan.c +++ b/reactos/drivers/network/tcpip/datalink/lan.c @@ -850,6 +850,8 @@ static NTSTATUS FindDeviceDescForAdapter( PUNICODE_STRING Name, ExAllocatePool(NonPagedPool, sizeof(KEY_BASIC_INFORMATION)); ULONG KbioLength = sizeof(KEY_BASIC_INFORMATION), ResultLength; + RtlInitUnicodeString( DeviceDesc, NULL ); + if( !Kbio ) return STATUS_INSUFFICIENT_RESOURCES; RtlInitUnicodeString @@ -904,8 +906,6 @@ static NTSTATUS FindDeviceDescForAdapter( PUNICODE_STRING Name, } } - RtlInitUnicodeString( DeviceDesc, L"" ); - AppendUnicodeString( DeviceDesc, &TargetKeyName, FALSE ); NtClose( EnumKey ); ExFreePool( Kbio ); return STATUS_UNSUCCESSFUL;