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

Unified Diff: chrome/installer/mini_installer/mini_installer.cc

Issue 154113004: Add quotes around executable pathes in the mini installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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/installer/mini_installer/mini_installer.cc
diff --git a/chrome/installer/mini_installer/mini_installer.cc b/chrome/installer/mini_installer/mini_installer.cc
index 28a8057627e67353dc4fb8d737337f467ea22a56..44517ef6820665ccc3add43793d9e669fa4043fc 100644
--- a/chrome/installer/mini_installer/mini_installer.cc
+++ b/chrome/installer/mini_installer/mini_installer.cc
@@ -229,8 +229,17 @@ bool GetSetupExePathForGuidFromRegistry(bool system_level,
size_t size) {
const HKEY root_key = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
RegKey key;
- return OpenClientStateKey(root_key, app_guid, KEY_QUERY_VALUE, &key) &&
- (key.ReadValue(kUninstallRegistryValueName, path, size) == ERROR_SUCCESS);
+ wchar_t unquoted_path[MAX_PATH] = {0};
+ if (!OpenClientStateKey(root_key, app_guid, KEY_QUERY_VALUE, &key) ||
+ (key.ReadValue(kUninstallRegistryValueName,
+ unquoted_path,
tommi (sloooow) - chröme 2014/02/04 21:55:14 I mean here. Since unquoted_path will contain a v
Cris Neckar 2014/02/04 22:53:05 Ah I misunderstood, thought you were asking if thi
+ MAX_PATH) != ERROR_SUCCESS)) {
+ return false;
+ }
+
+ return !SafeStrCopy(path, size, L"\"") &&
+ !SafeStrCat(path, size, unquoted_path) &&
+ !SafeStrCat(path, size, L"\"");
}
// Gets the setup.exe path from Registry by looking the value of Uninstall
« 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