From 4e03adc2e7ddaa9c61ded36ec87668c901d43867 Mon Sep 17 00:00:00 2001 From: Mounir IDRASSI Date: Sun, 8 Feb 2015 23:24:23 +0100 Subject: Static Code Analysis: Add more checks. Avoid unhandled ATL exceptions by checking memory allocation. Avoid throwing exception in File constructor and simplify code. --- src/Common/BaseCom.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/Common/BaseCom.cpp') 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 (device ? new Device (string (szFilePathA.m_psz), !write) : new File (string (szFilePathA.m_psz), !write)); + file->CheckOpened (); file->SeekAt (offset); if (write) -- cgit v1.2.3