a11y atspi: Ignore malformed text attr instead of crashing
If the attribute does not follow the required "name:value" syntax, ignore it, rather than crashing if it doesn't contain any colon. Same issue as spotted by Jan Arve Sæther during the review of a QTBUG-118106 related change that would have introduced the same issue in UIA code. Pick-to: 6.5 Change-Id: Id391502ed7aec7f09ef2826a456f2e4737af045e Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io> (cherry picked from commit b0bcf475694114bf503167bd11f14647880cd6b6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
5e5e5911e0
commit
d79e52be22
@ -2261,11 +2261,13 @@ QVariantList AtSpiAdaptor::getAttributes(QAccessibleInterface *interface, int of
|
|||||||
QString joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
|
QString joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset);
|
||||||
const QStringList attributes = joined.split(u';', Qt::SkipEmptyParts, Qt::CaseSensitive);
|
const QStringList attributes = joined.split(u';', Qt::SkipEmptyParts, Qt::CaseSensitive);
|
||||||
for (const QString &attr : attributes) {
|
for (const QString &attr : attributes) {
|
||||||
QStringList items;
|
QStringList items = attr.split(u':', Qt::SkipEmptyParts, Qt::CaseSensitive);
|
||||||
items = attr.split(u':', Qt::SkipEmptyParts, Qt::CaseSensitive);
|
if (items.count() == 2)
|
||||||
AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
|
{
|
||||||
if (!attribute.isNull())
|
AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]);
|
||||||
set[attribute.name] = attribute.value;
|
if (!attribute.isNull())
|
||||||
|
set[attribute.name] = attribute.value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVariantList list;
|
QVariantList list;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user