diff --git a/src/app/AttributePathExpandIterator.cpp b/src/app/AttributePathExpandIterator.cpp index 5abdb6c84737e8..b09cd85b79adbd 100644 --- a/src/app/AttributePathExpandIterator.cpp +++ b/src/app/AttributePathExpandIterator.cpp @@ -131,7 +131,9 @@ void AttributePathExpandIterator::PrepareAttributeIndexRange(const AttributePath { if (GlobalAttributesNotInMetadata[idx] == aAttributePath.mAttributeId) { - mGlobalAttributeIndex = idx; + // generally safe: we have a static cast check for GlobalAttributesNotInMetaData size + VerifyOrDie(idx <= UINT8_MAX); + mGlobalAttributeIndex = static_cast(idx); break; } }