fix possible crash if GetVolumeInformation fails: szVolumeNameBuffer would

be uninitialized
This commit is contained in:
Glenn Maynard
2005-12-24 06:06:45 +00:00
parent 635434ea17
commit 0a087099b6
@@ -20,17 +20,19 @@ static bool TestReady( const CString &sDrive, CString &sVolumeLabelOut )
DWORD lpFileSystemFlags;
TCHAR szFileSystemNameBuffer[MAX_PATH];
bool bRet = !!GetVolumeInformation(
sDrive,
if( !GetVolumeInformation(
"j:",
szVolumeNameBuffer,
sizeof(szVolumeNameBuffer),
&dwVolumeSerialNumber,
&dwMaximumComponentLength,
&lpFileSystemFlags,
szFileSystemNameBuffer,
sizeof(szFileSystemNameBuffer) );
sizeof(szFileSystemNameBuffer)) )
return false;
sVolumeLabelOut = szVolumeNameBuffer;
return bRet;
return true;
}
bool MemoryCardDriverThreaded_Windows::TestWrite( UsbStorageDevice* pDevice )