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

Unified Diff: chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc

Issue 1108643002: Handle single-byte exports in SafeBrowsingModuleVerifierWinTest.NewVerifyModuleExportModified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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: chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc b/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc
index 5d3d84ac102f07b7478cc14b3797b7a3f86876ff..33ccce19e5abec6b6ae42ce5613726c12cc120f1 100644
--- a/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/module_integrity_verifier_win_unittest.cc
@@ -364,9 +364,11 @@ TEST_F(SafeBrowsingModuleVerifierWinTest, NewVerifyModuleExportModified) {
ASSERT_EQ(1U, modification_map[kTestExportName].size());
uint32_t export_offset = modification_map[kTestExportName][0]->file_offset();
- // Edit another exported function. VerifyModule should now report both.
+ // Edit another exported function. VerifyModule should now report both. Add
+ // one to the address so that this modification and the previous are not
+ // coalesced in the event that the first export is only one byte (e.g., ret).
+ ScopedModuleModifier<1> mod2(GetAddressOfExport(kTestDllMainExportName) + 1);
state.Clear();
- ScopedModuleModifier<1> mod2(GetAddressOfExport(kTestDllMainExportName));
result = NewVerifyModule(kTestDllNames[0], &state);
EXPECT_EQ(MODULE_STATE_MODIFIED, result.state);
ASSERT_EQ(2, state.modification_size());
« 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