[cr144] Use UNSAFE_TODO for chromium_src override.
The upstream code we override uses UNSAFE_TODO, so we'll match for now.
In file included from ../../brave/chromium_src/chrome/installer/util/shell_util.cc:72:
../..\chrome/installer/util/shell_util.cc(484,5): error: unsafe buffer access [-Werror,-Wunsafe-buffer-usage]
484 | BRAVE_GET_SHELL_INTEGRATION_ENTRIES
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../brave/chromium_src/chrome/installer/util/shell_util.cc(59,33): note: expanded from macro 'BRAVE_GET_SHELL_INTEGRATION_ENTRIES'
59 | const std::wstring file_ext = ShellUtil::kPotentialFileAssociations[i]; \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../..\chrome/installer/util/shell_util.cc(484,5): note: See //docs/unsafe_buffers.md for help.
../../brave/chromium_src/chrome/installer/util/shell_util.cc(59,33): note: expanded from macro 'BRAVE_GET_SHELL_INTEGRATION_ENTRIES'
59 | const std::wstring file_ext = ShellUtil::kPotentialFileAssociations[i]; \
| ^
1 error generated.
Chromium change:
https://source.chromium.org/chromium/chromium/src/+/ce967e366f66cb46d2c8b8219fa2972ed9d64762
commit ce967e366f66cb46d2c8b8219fa2972ed9d64762
Author: Arthur Sonzogni <arthursonzogni@chromium.org>
Date: Thu Nov 20 04:35:05 2025 -0800
Convert to UNSAFE_TODO in chrome
This is an automated #cleanup patch using the [Script] below.
We are migrating from coarse-grained file-level suppression (#pragma
allow_unsafe_buffers) to granular, expression-level markers
(UNSAFE_TODO()). The pragma disables safety checks for an entire file,
whereas UNSAFE_TODO() isolates specific potentially unsafe operations,
allowing the rest of the file to be enforced as safe.
This CL was uploaded by an experimental version of git cl split
(https://crbug.com/389069356).
Script: https://docs.google.com/document/d/1ORQGBNn2R-CEvNbDTjRd-GrOBOFlCxIHdcvSUA_EhR4/edit?usp=sharing
AX-Relnotes: N/A
Cleanup: This is an automated #cleanup.
Bug: 409340989
This commit is contained in:
@@ -55,13 +55,14 @@ int GetIconIndexForFileType() {
|
||||
|
||||
// Give BraveXXFile prog id for some file type.(ex, .pdf or .svg) instead of
|
||||
// BraveHTML.
|
||||
#define BRAVE_GET_SHELL_INTEGRATION_ENTRIES \
|
||||
const std::wstring file_ext = ShellUtil::kPotentialFileAssociations[i]; \
|
||||
if (installer::ShouldUseFileTypeProgId(file_ext)) { \
|
||||
entries->push_back(std::make_unique<RegistryEntry>( \
|
||||
capabilities + L"\\FileAssociations", file_ext, \
|
||||
installer::GetProgIdForFileType())); \
|
||||
continue; \
|
||||
#define BRAVE_GET_SHELL_INTEGRATION_ENTRIES \
|
||||
UNSAFE_TODO(const std::wstring file_ext = \
|
||||
ShellUtil::kPotentialFileAssociations[i];) \
|
||||
if (installer::ShouldUseFileTypeProgId(file_ext)) { \
|
||||
entries->push_back(std::make_unique<RegistryEntry>( \
|
||||
capabilities + L"\\FileAssociations", file_ext, \
|
||||
installer::GetProgIdForFileType())); \
|
||||
continue; \
|
||||
}
|
||||
#else
|
||||
#define BRAVE_GET_CHROME_PROG_ID_ENTRIES
|
||||
|
||||
Reference in New Issue
Block a user