Author: cgutman
Date: Thu Aug 13 01:14:49 2009
New Revision: 42642
URL:
http://svn.reactos.org/svn/reactos?rev=42642&view=rev
Log:
- Don't access an uninitialized variable
- Initialize the unicode string at the start of the function
- Spotted by Amine Khaldi
Modified:
trunk/reactos/drivers/network/tcpip/datalink/lan.c
Modified: trunk/reactos/drivers/network/tcpip/datalink/lan.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/drivers/network/tcpip/data…
==============================================================================
--- trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] (original)
+++ trunk/reactos/drivers/network/tcpip/datalink/lan.c [iso-8859-1] Thu Aug 13 01:14:49
2009
@@ -850,6 +850,8 @@
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 @@
}
}
- RtlInitUnicodeString( DeviceDesc, L"" );
- AppendUnicodeString( DeviceDesc, &TargetKeyName, FALSE );
NtClose( EnumKey );
ExFreePool( Kbio );
return STATUS_UNSUCCESSFUL;