diff options
author | Michael Weghorn <[email protected]> | 2023-11-14 23:31:45 +0100 |
---|---|---|
committer | Michael Weghorn <[email protected]> | 2023-11-16 14:34:17 +0100 |
commit | b0bcf475694114bf503167bd11f14647880cd6b6 (patch) | |
tree | 3314eb9c4f0734dd6c0d0ba44bfc6e7ae94d112a /src/gui/accessible | |
parent | f2c5b846e092270e1f43b0625db26789a5f77ba6 (diff) |
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.6 6.5
Change-Id: Id391502ed7aec7f09ef2826a456f2e4737af045e
Reviewed-by: Jan Arve Sæther <[email protected]>
Diffstat (limited to 'src/gui/accessible')
-rw-r--r-- | src/gui/accessible/linux/atspiadaptor.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/accessible/linux/atspiadaptor.cpp b/src/gui/accessible/linux/atspiadaptor.cpp index 6b4c80cf60f..877582a92a2 100644 --- a/src/gui/accessible/linux/atspiadaptor.cpp +++ b/src/gui/accessible/linux/atspiadaptor.cpp @@ -2276,11 +2276,13 @@ QVariantList AtSpiAdaptor::getAttributes(QAccessibleInterface *interface, int of QString joined = interface->textInterface()->attributes(offset, &startOffset, &endOffset); const QStringList attributes = joined.split(u';', Qt::SkipEmptyParts, Qt::CaseSensitive); for (const QString &attr : attributes) { - QStringList items; - items = attr.split(u':', Qt::SkipEmptyParts, Qt::CaseSensitive); - AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]); - if (!attribute.isNull()) - set[attribute.name] = attribute.value; + QStringList items = attr.split(u':', Qt::SkipEmptyParts, Qt::CaseSensitive); + if (items.count() == 2) + { + AtSpiAttribute attribute = atspiTextAttribute(items[0], items[1]); + if (!attribute.isNull()) + set[attribute.name] = attribute.value; + } } QVariantList list; |