summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-01-23 15:43:50 +0100
committerEike Rathke <erack@redhat.com>2012-01-23 15:43:50 +0100
commita7769e27849b74102e11540d7753576528323114 (patch)
tree7139a9a7c62460603b8af1fca50ff1939bd8e1c5 /sc
parent5cde352b9622c0e009b52e4848c84584d03e0d5d (diff)
resolved rhbz#783556 crash in ScMatrix::GetDimensons() from ScInterpreter
* Interpreter tried to access a nonexistent matrix for external reference. * In ScInterpreter::PopExternalDoubleRef(ScMatrixRef& rMat) set error for unexpected conditions. In caller or descendants check for error or presence of ScMatrix.
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/interpr4.cxx11
1 files changed, 10 insertions, 1 deletions
diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index cda83d30fea3..b6492dda0a32 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1285,6 +1285,8 @@ ScDBRangeBase* ScInterpreter::PopDBDoubleRef()
pMat = PopMatrix();
else
PopExternalDoubleRef(pMat);
+ if (nGlobalError)
+ break;
return new ScDBExternalRange(pDok, pMat);
}
default:
@@ -1541,7 +1543,14 @@ void ScInterpreter::PopExternalDoubleRef(ScMatrixRef& rMat)
// references, which means the array should only contain a
// single matrix token.
ScToken* p = static_cast<ScToken*>(pArray->First());
- rMat = p->GetMatrix();
+ if (!p || p->GetType() != svMatrix)
+ SetError( errIllegalParameter);
+ else
+ {
+ rMat = p->GetMatrix();
+ if (!rMat)
+ SetError( errUnknownVariable);
+ }
}
void ScInterpreter::GetExternalDoubleRef(