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

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..ac79fcba3bf204e0853b1cab244828ce7f23b713 100644
--- a/chrome/installer/mini_installer/mini_installer.cc
+++ b/chrome/installer/mini_installer/mini_installer.cc
@@ -229,8 +229,19 @@ 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};
grt (UTC plus 2) 2014/02/05 03:13:50 {0} -> {}
Cris Neckar 2014/02/06 20:56:23 Done.
+ if (!OpenClientStateKey(root_key, app_guid, KEY_QUERY_VALUE, &key) ||
+ (key.ReadValue(kUninstallRegistryValueName,
+ unquoted_path,
+ MAX_PATH) != ERROR_SUCCESS)) {
grt (UTC plus 2) 2014/02/05 03:13:50 MAX_PATH -> arraysize(unquoted_path)
Cris Neckar 2014/02/06 20:56:23 Done.
+ return false;
+ }
+ if (unquoted_path[0] == '\"')
+ return SafeStrCopy(path, size, unquoted_path);
+
+ return SafeStrCopy(path, size, L"\"") &&
+ SafeStrCat(path, size, unquoted_path) &&
grt (UTC plus 2) 2014/02/05 03:13:50 nit: either four-space indent, or add parens for:
Cris Neckar 2014/02/06 20:56:23 Done.
+ 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