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

Unified Diff: chrome/browser/webdata/web_database.cc

Issue 10754005: Merge 145665 - Force WebDatabase version to max(version, compatible version) before migration. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1132/src/
Patch Set: Created 8 years, 5 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/webdata/web_database.cc
===================================================================
--- chrome/browser/webdata/web_database.cc (revision 145728)
+++ chrome/browser/webdata/web_database.cc (working copy)
@@ -158,8 +158,15 @@
}
sql::InitStatus WebDatabase::MigrateOldVersionsAsNeeded() {
+ // Some malware tries to force protector to re-sign things by lowering the
+ // version number, causing migration to fail. Ensure the version number is at
+ // least as high as the compatible version number.
+ int current_version = std::max(meta_table_.GetVersionNumber(),
+ meta_table_.GetCompatibleVersionNumber());
+ if (current_version < meta_table_.GetCompatibleVersionNumber())
+ ChangeVersion(&meta_table_, current_version, false);
+
// Migrate if necessary.
- int current_version = meta_table_.GetVersionNumber();
switch (current_version) {
// Versions 1 - 19 are unhandled. Version numbers greater than
// kCurrentVersionNumber should have already been weeded out by the caller.
« 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