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>