QXmlAttributes: do not allow more than INT_MAX attributes


The implementation stores the attributes in a QList, meaning that its
size is represented as qsizetype.

However, the public API, like index() and length() only returns int.
This may lead to a (very unlikely in practice) situation when some of
the parsed attributes are not accessible to the user.

To avoid such situations, this patch limits the amount of attributes
for a single element to INT_MAX. If a document contains an element with
more than INT_MAX attibutes, it is considered malformed, and an error
is reported.

Task-number: QTBUG-149566
Pick-to: 6.12 6.12.0 6.11 6.11.3 6.8 6.5
Change-Id: I4d930a4c8917154d895311b96bbb3904d79d6495
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
commita8def6219491537fd9dbdb74d98b8f67946ad82d
parent6cae8a4aebc82fb59116d55a551c168b2cd9e053
authorIvan Solovev <ivan.solovev@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeMon, 14 Sep 2026 12:14:26 +0000