diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-01-13 08:56:29 +0100 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2023-01-25 13:53:07 +0000 |
commit | 4772cb9b17900fc9442664e2cdd18c75bb791790 (patch) | |
tree | 74c5cc7be25d4d05bf5757e39be1cf966ff56b63 | |
parent | Update git submodules (diff) | |
download | core-4772cb9b17900fc9442664e2cdd18c75bb791790.tar.gz core-4772cb9b17900fc9442664e2cdd18c75bb791790.zip |
sc: fix crash in ScViewData::GetCurXForTab()
Crashreport signature:
program/libsclo.so
ScViewData::GetCurXForTab(short) const
sc/source/ui/view/viewdata.cxx:1431
program/libsclo.so
ScViewFunc::OnLOKInsertDeleteColumn(short, long)
sc/source/ui/view/viewfunc.cxx:1552
program/libsclo.so
ScDocFunc::InsertCells(ScRange const&, ScMarkData const*, InsCellCmd, bool, bool, bool)
source/ui/docshell/docfunc.cxx:2256
program/libsclo.so
ScViewFunc::InsertCells(InsCellCmd, bool, bool)
sc/source/ui/view/viewfunc.cxx:1658
Seeing that e.g. ScViewData::WriteUserDataSequence() already checks if
the pointer in maTabData is a nullptr, do the same here.
Change-Id: I0ebdba8c8a5bedd3c3c57c36bdf0632e2fee45c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145697
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
(cherry picked from commit 1f8c02353d653a6d4a72d918aaf6be5f367137c9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145729
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 98fda531df5546ef39e24a3de00f36bb7196e28d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146018
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Tested-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 0ef96d96c7ae..ae68a5dfc725 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -1429,7 +1429,7 @@ SCROW ScViewData::GetPosY( ScVSplitPos eWhich, SCTAB nForTab ) const SCCOL ScViewData::GetCurXForTab( SCTAB nTabIndex ) const { - if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size()))) + if (!ValidTab(nTabIndex) || (nTabIndex >= static_cast<SCTAB>(maTabData.size())) || !maTabData[nTabIndex]) return -1; return maTabData[nTabIndex]->nCurX; |