[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sw/source
LeMoyne Castle
lemoyne.castle at gmail.com
Thu May 4 20:42:37 UTC 2017
sw/source/core/unocore/unotbl.cxx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
New commits:
commit 066cd52857ad9c2494c584bc36b38fc34836d10f
Author: LeMoyne Castle <lemoyne.castle at gmail.com>
Date: Tue Apr 25 22:44:16 2017 -0600
tdf#107350 - prevent crash in unotbl.cxx
check pointer and throw exception instead of SIGABRT
when reading data from text tables that have
varying row &/or col lengths from
- merged cells after first row,
- split cells in first row, etc.
add backstop safety check -> exception because
- complexity check fails (wrong/not called)
- OOo uno api doc calls for exception when
text table is 'too complex'
v2: better error message for crash point and
its parallel (getData[Array])
Change-Id: Ifb844c3e29042dab6b6cdb2448f7728e6ccb631d
Reviewed-on: https://gerrit.libreoffice.org/37002
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Björn Michaelsen <bjoern.michaelsen at libreoffice.org>
(cherry picked from commit eea79562f1a5785a8a22cde732a091725e46bbad)
Reviewed-on: https://gerrit.libreoffice.org/37264
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 0eab02785d22..4087921e9666 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -3697,7 +3697,7 @@ uno::Sequence<uno::Sequence<uno::Any>> SAL_CALL SwXCellRange::getDataArray()
{
auto pCell(static_cast<SwXCell*>(pCurrentCell->get()));
if(!pCell)
- throw uno::RuntimeException();
+ throw uno::RuntimeException("Table too complex", static_cast<cppu::OWeakObject*>(this));
rCellAny = pCell->GetAny();
++pCurrentCell;
}
@@ -3764,6 +3764,8 @@ SwXCellRange::getData() throw (uno::RuntimeException, std::exception)
rRow = uno::Sequence<double>(nColCount);
for(auto& rValue : rRow)
{
+ if (!(*pCurrentCell).is())
+ throw uno::RuntimeException("Table too complex", static_cast<cppu::OWeakObject*>(this));
rValue = (*pCurrentCell)->getValue();
++pCurrentCell;
}
More information about the Libreoffice-commits
mailing list