summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-06 01:08:49 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-11-06 01:08:49 +0000
commitdcc8f1c678af98247adc7a056ace7e6c145ed189 (patch)
tree753f9822a6a99bb901c2314d2b1eec2f984c00df /chrome/installer
parentd10bba63c96c40a8270bf2d62af87dd40c65067d (diff)
downloadchromium_src-dcc8f1c678af98247adc7a056ace7e6c145ed189.zip
chromium_src-dcc8f1c678af98247adc7a056ace7e6c145ed189.tar.gz
chromium_src-dcc8f1c678af98247adc7a056ace7e6c145ed189.tar.bz2
Fixes a crash if you put chrome in a very short directory
- like c:\bang. - it will crash at startup on a bad iterator use. BUG=4112 Review URL: http://codereview.chromium.org/9610 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4854 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/util/install_util.cc11
1 files changed, 2 insertions, 9 deletions
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index bec4af8..188b653 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -114,20 +114,13 @@ void InstallUtil::WriteInstallerResult(bool system_install,
}
bool InstallUtil::IsPerUserInstall(const wchar_t* const exe_path) {
- std::wstring exe_path_copy = exe_path;
wchar_t program_files_path[MAX_PATH] = {0};
if (SUCCEEDED(SHGetFolderPath(NULL, CSIDL_PROGRAM_FILES, NULL,
SHGFP_TYPE_CURRENT, program_files_path))) {
- std::wstring program_files_path_copy = program_files_path;
-
- if (std::equal(program_files_path_copy.begin(),
- program_files_path_copy.end(), exe_path_copy.begin(),
- CaseInsensitiveCompare<wchar_t>())) {
- return false;
- }
+ return !StartsWith(exe_path, program_files_path, false);
} else {
NOTREACHED();
}
return true;
-} \ No newline at end of file
+}