commit | caffccb5b7ea20eca217799a26bcdefea40a8dba | [log] [tgz] |
---|---|---|
author | Christoph Schwering <schwering@google.com> | Wed Mar 19 16:52:40 2025 |
committer | Chromium LUCI CQ <chromium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Wed Mar 19 16:52:40 2025 |
tree | 97ff9ea2909850353d648a69993738627d84f22c | |
parent | f4d5c9c509cc00726d011cc0513283b335c7152a [diff] |
[Autofill] Fix index-out-of-bounds in AttributeType::DisambiguationOrder() Bug: 404824551 Change-Id: I70d6d58e3586ccea1663b97671be616de46161b7 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6372824 Commit-Queue: Christoph Schwering <schwering@google.com> Reviewed-by: Jan Keitel <jkeitel@google.com> Cr-Commit-Position: refs/heads/main@{#1434891}
diff --git a/components/autofill/core/browser/data_model/autofill_ai/transpile_entity_schema.py b/components/autofill/core/browser/data_model/autofill_ai/transpile_entity_schema.py index 3da6b66f..c271252 100755 --- a/components/autofill/core/browser/data_model/autofill_ai/transpile_entity_schema.py +++ b/components/autofill/core/browser/data_model/autofill_ai/transpile_entity_schema.py
@@ -186,7 +186,7 @@ yield 'bool AttributeType::DisambiguationOrder(const AttributeType& lhs, const AttributeType& rhs) {' yield ' constexpr auto rank = [](const AttributeType& a) {' yield ' static constexpr auto ranks = [] {' - yield ' std::array<int, base::to_underlying(AttributeTypeName::kMaxValue)> ranks{};' + yield ' std::array<int, base::to_underlying(AttributeTypeName::kMaxValue) + 1> ranks{};' yield ' for (int& rank : ranks) {' yield ' rank = std::numeric_limits<int>::max();' yield ' }'