commit | b2a6e2cbf95ff27efe7cc3d6d7329e452c57a64e | [log] [tgz] |
---|---|---|
author | David Bertoni <dbertoni@chromium.org> | Fri Dec 20 23:46:05 2024 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Fri Dec 20 23:46:05 2024 |
tree | 2a0da8065c55f1f5690f2cb4127c446e9b121d94 | |
parent | e6541dfe3b47e04c247938ddf9d523fbdad92d0d [diff] |
[Extensions] Fix some unsafe buffer usages in extensions. This CL fixes some of these usages through a variety of approaches: 1. Loops where arrays are index by a loop control variable are converted to use range-based for loops when possible. 2. When that's the possible, the array is converted to std::array or std::vector, since those have range checks enabled. The preference is for std::array when possible, for efficiency. 3. Unsafe construction of base::span is replace by requesting a span from the object that was used to originally construct the span. 4. Uses of unsafe pointer arithmetic to index into arrays are generally replaced with uses of operator[] or std::begin/std::end. Many objects have been made constexpr. In some cases, code that was unsafe had already been rewritten, so the pragma blocks were removed. Bug: 351564777 Change-Id: Idab427be3c663ec0332f2733f4476cea2a2dd29d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6108199 Reviewed-by: Tim <tjudkins@chromium.org> Auto-Submit: David Bertoni <dbertoni@chromium.org> Commit-Queue: David Bertoni <dbertoni@chromium.org> Cr-Commit-Position: refs/heads/main@{#1399417}
Chromium is an open-source browser project that aims to build a safer, faster, and more stable way for all users to experience the web.
The project's web site is https://www.chromium.org.
To check out the source code locally, don't use git clone
! Instead, follow the instructions on how to get the code.
Documentation in the source is rooted in docs/README.md.
Learn how to Get Around the Chromium Source Code Directory Structure.
For historical reasons, there are some small top level directories. Now the guidance is that new top level directories are for product (e.g. Chrome, Android WebView, Ash). Even if these products have multiple executables, the code should be in subdirectories of the product.
If you found a bug, please file it at https://crbug.com/new.