[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 '      }'