diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-03-20 16:47:49 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-03-21 08:54:43 +0000 |
commit | 46c95fa7407df716795d4350506d57b2ed1fb11d (patch) | |
tree | 641e4ee722bbfcc706d990446ccfb48e12cbeec1 /starmath/source/cursor.cxx | |
parent | 84c4838febc60af47f61795d3ca0884edb39f0e4 (diff) |
coverity#736099 Improper use of negative value
Change-Id: I065a8074fcafba123898c70eded464aa108e2e9e
Diffstat (limited to 'starmath/source/cursor.cxx')
-rw-r--r-- | starmath/source/cursor.cxx | 5 |
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); |