summaryrefslogtreecommitdiff
path: root/starmath/source/cursor.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-20 16:47:49 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-21 08:54:43 +0000
commit46c95fa7407df716795d4350506d57b2ed1fb11d (patch)
tree641e4ee722bbfcc706d990446ccfb48e12cbeec1 /starmath/source/cursor.cxx
parent84c4838febc60af47f61795d3ca0884edb39f0e4 (diff)
coverity#736099 Improper use of negative value
Change-Id: I065a8074fcafba123898c70eded464aa108e2e9e
Diffstat (limited to 'starmath/source/cursor.cxx')
-rw-r--r--starmath/source/cursor.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx
index d05a1b85b022..5b9847611c9b 100644
--- a/starmath/source/cursor.cxx
+++ b/starmath/source/cursor.cxx
@@ -302,6 +302,11 @@ void SmCursor::InsertNodes(SmNodeList* pNewNodes){
SmStructureNode* pLineParent = pLine->GetParent();
int nParentIndex = pLineParent->IndexOfSubNode(pLine);
OSL_ENSURE(nParentIndex != -1, "pLine must be a subnode of pLineParent!");
+ if (nParentIndex == -1)
+ {
+ delete pNewNodes;
+ return;
+ }
//Convert line to list
SmNodeList* pLineList = NodeToList(pLine);