1
0
mirror of https://github.com/veracrypt/VeraCrypt.git synced 2025-11-11 19:08:26 -06:00

Static Code Analysis: Add more checks. Avoid unhandled ATL exceptions by checking memory allocation. Avoid throwing exception in File constructor and simplify code.

This commit is contained in:
Mounir IDRASSI
2015-02-08 23:24:23 +01:00
parent d1a3316e44
commit 4e03adc2e7
3 changed files with 184 additions and 74 deletions

View File

@@ -134,6 +134,7 @@ DWORD BaseCom::ReadWriteFile (BOOL write, BOOL device, BSTR filePath, BSTR *buff
try
{
auto_ptr <File> file (device ? new Device (string (szFilePathA.m_psz), !write) : new File (string (szFilePathA.m_psz), !write));
file->CheckOpened ();
file->SeekAt (offset);
if (write)