From 33f1c9e357927b0f5ead964a19763750427869a9 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Fri, 2 Sep 2022 08:29:47 +0200 Subject: a11y atspi: Add null check in GetRowHeader handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Just like the GetColumnHeader case already does, check that the cell isn't nullptr before trying to retrieve the table cell interface from it. (Not doing so e.g. resulted in a crash with WIP branches of LibreOffice and Orca to make selected cells with a child index not fitting into 32 bit work, s.a. https://bugs.documentfoundation.org/show_bug.cgi?id=150683 ) Change-Id: Idd55fd1f0c49b616c732ddb683814605a46ff319 Reviewed-by: Tor Arne Vestbø (cherry picked from commit 5462485a59373b9871261910895b9b8987442b48) --- src/gui/accessible/linux/atspiadaptor.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/accessible/linux/atspiadaptor.cpp b/src/gui/accessible/linux/atspiadaptor.cpp index 7ab9fe2697..63c46bcd6f 100644 --- a/src/gui/accessible/linux/atspiadaptor.cpp +++ b/src/gui/accessible/linux/atspiadaptor.cpp @@ -2444,9 +2444,9 @@ bool AtSpiAdaptor::tableInterface(QAccessibleInterface *interface, const QString } else if (function == QLatin1String("GetRowHeader")) { int row = message.arguments().at(0).toInt(); QSpiObjectReference ref; - QAccessibleTableCellInterface *cell = interface->tableInterface()->cellAt(row, 0)->tableCellInterface(); - if (cell) { - QList header = cell->rowHeaderCells(); + QAccessibleInterface *cell = interface->tableInterface()->cellAt(row, 0); + if (cell && cell->tableCellInterface()) { + QList header = cell->tableCellInterface()->rowHeaderCells(); if (header.size() > 0) { ref = QSpiObjectReference(connection, QDBusObjectPath(pathForInterface(header.takeAt(0)))); } -- cgit v1.2.3