diff options
author | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-02-08 23:24:23 +0100 |
---|---|---|
committer | Mounir IDRASSI <mounir.idrassi@idrix.fr> | 2015-02-09 11:01:03 +0100 |
commit | 4e03adc2e7ddaa9c61ded36ec87668c901d43867 (patch) | |
tree | a75b844369fb756077564da92f9fb6e704cd0a8d /src/Common/BaseCom.cpp | |
parent | d1a3316e4486433cb4d3f74016479998ac3ea62a (diff) | |
download | VeraCrypt-4e03adc2e7ddaa9c61ded36ec87668c901d43867.tar.gz VeraCrypt-4e03adc2e7ddaa9c61ded36ec87668c901d43867.zip |
Static Code Analysis: Add more checks. Avoid unhandled ATL exceptions by checking memory allocation. Avoid throwing exception in File constructor and simplify code.
Diffstat (limited to 'src/Common/BaseCom.cpp')
-rw-r--r-- | src/Common/BaseCom.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Common/BaseCom.cpp b/src/Common/BaseCom.cpp index 9a0c26f7..365fa293 100644 --- a/src/Common/BaseCom.cpp +++ b/src/Common/BaseCom.cpp @@ -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)
|