- 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
This commit is contained in:
Cameron Gutman 2009-08-12 23:14:49 +00:00
parent 09286edbce
commit 10b13ed7c9

View file

@ -850,6 +850,8 @@ static NTSTATUS FindDeviceDescForAdapter( PUNICODE_STRING Name,
ExAllocatePool(NonPagedPool, sizeof(KEY_BASIC_INFORMATION)); ExAllocatePool(NonPagedPool, sizeof(KEY_BASIC_INFORMATION));
ULONG KbioLength = sizeof(KEY_BASIC_INFORMATION), ResultLength; ULONG KbioLength = sizeof(KEY_BASIC_INFORMATION), ResultLength;
RtlInitUnicodeString( DeviceDesc, NULL );
if( !Kbio ) return STATUS_INSUFFICIENT_RESOURCES; if( !Kbio ) return STATUS_INSUFFICIENT_RESOURCES;
RtlInitUnicodeString RtlInitUnicodeString
@ -904,8 +906,6 @@ static NTSTATUS FindDeviceDescForAdapter( PUNICODE_STRING Name,
} }
} }
RtlInitUnicodeString( DeviceDesc, L"" );
AppendUnicodeString( DeviceDesc, &TargetKeyName, FALSE );
NtClose( EnumKey ); NtClose( EnumKey );
ExFreePool( Kbio ); ExFreePool( Kbio );
return STATUS_UNSUCCESSFUL; return STATUS_UNSUCCESSFUL;