diff options
Diffstat (limited to 'chrome/installer/util/l10n_string_util.cc')
-rw-r--r-- | chrome/installer/util/l10n_string_util.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/chrome/installer/util/l10n_string_util.cc b/chrome/installer/util/l10n_string_util.cc index 32ac7c4..3269516 100644 --- a/chrome/installer/util/l10n_string_util.cc +++ b/chrome/installer/util/l10n_string_util.cc @@ -232,7 +232,11 @@ std::wstring GetLocalizedEulaResource() { // Spaces and DOS paths must be url encoded. std::wstring url_path = StringPrintf(L"res://%ls/#23/%ls", full_exe_path, resource); - DWORD count = url_path.size() * 3; + + // The cast is safe because url_path has limited length + // (see the definition of full_exe_path and resource). + DCHECK(kuint32max > (url_path.size() * 3)); + DWORD count = static_cast<DWORD>(url_path.size() * 3); scoped_array<wchar_t> url_canon(new wchar_t[count]); HRESULT hr = ::UrlCanonicalizeW(url_path.c_str(), url_canon.get(), &count, URL_ESCAPE_UNSAFE); |