summaryrefslogtreecommitdiff
path: root/plugins/PluginUpdater/src
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2014-01-09 11:34:23 +0000
committerGeorge Hazan <george.hazan@gmail.com>2014-01-09 11:34:23 +0000
commit3b2ee3d9578338d0b6f40721d1493945376d1029 (patch)
tree4f70f8b277c4dfb59a13ac2a1a8cf29e418286ff /plugins/PluginUpdater/src
parenta7dd3e40942c6280a3d7a8ed53312073ed153b5d (diff)
PluginUpdater not to crash on broken PE images
git-svn-id: http://svn.miranda-ng.org/main/trunk@7563 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/PluginUpdater/src')
-rw-r--r--plugins/PluginUpdater/src/DlgUpdate.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/plugins/PluginUpdater/src/DlgUpdate.cpp b/plugins/PluginUpdater/src/DlgUpdate.cpp
index 3682af171e..059dcaf552 100644
--- a/plugins/PluginUpdater/src/DlgUpdate.cpp
+++ b/plugins/PluginUpdater/src/DlgUpdate.cpp
@@ -475,10 +475,16 @@ static int ScanFolder(const TCHAR *tszFolder, size_t cbBaseLen, int level, const
ptszUrl = item->m_name;
char szMyHash[33];
- CalculateModuleHash(tszBuf, szMyHash);
+ __try {
+ CalculateModuleHash(tszBuf, szMyHash);
+ bHasNewVersion = opts.bForceRedownload ? true : strcmp(szMyHash, item->m_szHash) != 0;
+ }
+ __except(EXCEPTION_EXECUTE_HANDLER) {
+ ZeroMemory(szMyHash, 0);
+ bHasNewVersion = true; // smth went wrong, reload a file from scratch
+ }
MyCRC = item->m_crc;
- bHasNewVersion = opts.bForceRedownload ? true : strcmp(szMyHash, item->m_szHash) != 0;
}
else { // file was marked for deletion, add it to the list anyway
bHasNewVersion = true;