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

Unified Diff: chrome/browser/first_run_win.cc

Issue 204051: Fix crash during import by checking for errors and exiting early. (Closed)
Patch Set: Created 11 years, 3 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 | chrome/browser/importer/importer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/first_run_win.cc
diff --git a/chrome/browser/first_run_win.cc b/chrome/browser/first_run_win.cc
index 34329fef2fccee0360e4750a0551d695851ad34a..aedc7fbac39da606ee0f3cb025cd7391dd9293a4 100644
--- a/chrome/browser/first_run_win.cc
+++ b/chrome/browser/first_run_win.cc
@@ -520,8 +520,13 @@ bool DecodeImportParams(const std::wstring& encoded,
SplitString(encoded, L'@', &v);
if (v.size() != 3)
return false;
- *browser_type = static_cast<int>(StringToInt64(v[0]));
- *options = static_cast<int>(StringToInt64(v[1]));
+
+ if (!StringToInt(v[0], browser_type))
+ return false;
+
+ if (!StringToInt(v[1], options))
+ return false;
+
cpu_(ooo_6.6-7.5) 2009/09/21 21:28:54 the originals have '64' in them...
*window = reinterpret_cast<HWND>(StringToInt64(v[2]));
return true;
}
« no previous file with comments | « no previous file | chrome/browser/importer/importer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698