Chromium Code Reviews| Index: chrome/installer/mini_installer/decompress.cc |
| diff --git a/chrome/installer/mini_installer/decompress.cc b/chrome/installer/mini_installer/decompress.cc |
| index ed9098a85211d735ed004ba4f6f02e48e55b1d0e..4ace5ddd64f1c23c190d448ca076c4b19d7d612d 100644 |
| --- a/chrome/installer/mini_installer/decompress.cc |
| +++ b/chrome/installer/mini_installer/decompress.cc |
| @@ -5,6 +5,7 @@ |
| #include <windows.h> // NOLINT |
| #include <fcntl.h> // for _O_* constants |
| #include <fdi.h> |
| +#include <stdlib.h> |
|
grt (UTC plus 2)
2015/05/06 18:10:15
is this still needed?
tfarina
2015/05/06 18:16:07
Done.
|
| #include "chrome/installer/mini_installer/decompress.h" |
| @@ -190,13 +191,14 @@ bool InitializeFdi() { |
| L"C:\\Windows\\system32\\cabinet.dll", |
| }; |
| - wchar_t path[MAX_PATH] = {0}; |
| - for (int i = 0; i < arraysize(candidate_paths); ++i) { |
| + static const DWORD kBufferSize = MAX_PATH; |
| + wchar_t path[kBufferSize]; |
| + for (const wchar_t* candidate_path : candidate_paths) { |
| path[0] = L'\0'; |
| - DWORD result = ::ExpandEnvironmentStringsW(candidate_paths[i], |
| - path, arraysize(path)); |
| + DWORD result = ::ExpandEnvironmentStringsW(candidate_path, |
| + path, kBufferSize); |
| - if (result > 0 && result <= arraysize(path)) |
| + if (result > 0 && result <= kBufferSize) |
| g_fdi = ::LoadLibraryExW(path, NULL, LOAD_WITH_ALTERED_SEARCH_PATH); |
| if (g_fdi) |