sc/source/core/data/table3.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit ad61d80dde0424e1ed5c5b4c6bd7d50487567d75
Author:     Thorsten Behrens <thorsten.behr...@cib.de>
AuthorDate: Thu Sep 10 00:18:08 2020 +0200
Commit:     Thorsten Behrens <thorsten.behr...@cib.de>
CommitDate: Thu Sep 10 09:29:34 2020 +0200

    Check range before accessing Calc sort userlist
    
    Change-Id: I74df0bc6db978e06e8014ac1bc0d76a66c7f4fe8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102341
    Tested-by: Thorsten Behrens <thorsten.behr...@cib.de>
    Reviewed-by: Thorsten Behrens <thorsten.behr...@cib.de>

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 776ca2e3c51a..b4f1af735925 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -1520,9 +1520,9 @@ short ScTable::CompareCell(
                 bool bNaturalSort = aSortParam.bNaturalSort;    // natural sort
                 bool bCaseSens    = aSortParam.bCaseSens;       // case 
sensitivity
 
-                if (bUserDef)
+                ScUserList* pList = ScGlobal::GetUserList();
+                if (bUserDef && pList && pList->size() > aSortParam.nUserIndex)
                 {
-                    ScUserList* pList = ScGlobal::GetUserList();
                     const ScUserListData& rData = 
(*pList)[aSortParam.nUserIndex];
 
                     if ( bNaturalSort )
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to