Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1980)

Unified Diff: base/iat_patch.cc

Issue 21044: Hands off the intercept if 'unpatch' fails... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/iat_patch.cc
===================================================================
--- base/iat_patch.cc (revision 9103)
+++ base/iat_patch.cc (working copy)
@@ -208,12 +208,17 @@
DWORD error = RestoreImportedFunction(intercept_function_,
original_function_,
iat_thunk_);
+ DCHECK(NO_ERROR == error);
- if (NO_ERROR == error) {
- intercept_function_ = NULL;
- original_function_ = NULL;
- iat_thunk_ = NULL;
- }
+ // Hands off the intercept if we fail to unpatch.
+ // If IATPatchFunction::Unpatch fails during RestoreImportedFunction
+ // it means that we cannot safely unpatch the import address table
+ // patch. In this case its better to be hands off the intercept as
+ // trying to unpatch again in the destructor of IATPatchFunction is
+ // not going to be any safer
+ intercept_function_ = NULL;
+ original_function_ = NULL;
+ iat_thunk_ = NULL;
return error;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698