[Libreoffice-commits] core.git: dbaccess/source

Julien Nabet (via logerrit) logerrit at kemper.freedesktop.org
Mon Sep 6 20:52:12 UTC 2021


 dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 970883a85ad1d714683a1d98fb45efc89cbdeb3b
Author:     Julien Nabet <serval2412 at yahoo.fr>
AuthorDate: Mon Sep 6 21:45:42 2021 +0200
Commit:     Julien Nabet <serval2412 at yahoo.fr>
CommitDate: Mon Sep 6 22:51:37 2021 +0200

    tdf#140951: fix crash on Base when accessibility used
    
    See bt here:
    https://bugs.documentfoundation.org/attachment.cgi?id=174832
    
    Change-Id: Ia0a52b1e6aafc043f6be2d8406a98e7d4ebf55dc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121735
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2412 at yahoo.fr>

diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 3857e5db9f64..f008ce03a2ba 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -2105,6 +2105,8 @@ OUString OSelectionBrowseBox::GetCellText(sal_Int32 nRow, sal_uInt16 nColId) con
 {
 
     sal_uInt16 nPos = GetColumnPos(nColId);
+    if ( nPos == 0 || nPos == BROWSER_INVALIDID || nPos > getFields().size() )
+        return OUString();
 
     OTableFieldDescRef pEntry = getFields()[nPos-1];
     OSL_ENSURE(pEntry != nullptr, "OSelectionBrowseBox::GetCellText : invalid column id, prepare for GPF ... ");
@@ -2689,7 +2691,7 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef const & _pEntry)
 Reference< XAccessible > OSelectionBrowseBox::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos )
 {
     OTableFieldDescRef pEntry;
-    if(getFields().size() > o3tl::make_unsigned(_nColumnPos - 1))
+    if ( _nColumnPos != 0 && _nColumnPos != BROWSER_INVALIDID && _nColumnPos <= getFields().size() )
         pEntry = getFields()[_nColumnPos - 1];
 
     if ( _nRow == BROW_VIS_ROW && pEntry.is() )


More information about the Libreoffice-commits mailing list