summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-15 10:27:22 +0100
committerAndras Timar <andras.timar@collabora.com>2021-10-10 22:48:04 +0200
commit2cd30bf9e87b26068ff4ca742778db54a45b4b4a (patch)
treef05c1a13f8312f7d4e432d2a7ca0802e444ca3a4
parente4859e4eb90a6891ebef32e7d35ee54435e2cc87 (diff)
ofz#9908 validate no negative editengine selection positions
Change-Id: I37dace2051518224c55756362facd3edba4a9571 Reviewed-on: https://gerrit.libreoffice.org/59059 Tested-by: Jenkins Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com>
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 819df60f04ca..eff41e0aa422 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -564,7 +564,9 @@ namespace
bool IsValidSel(const EditEngine& rEngine, const ESelection& rSel)
{
const auto nParaCount = rEngine.GetParagraphCount();
- return rSel.nStartPara < nParaCount && rSel.nEndPara < nParaCount;
+ if (rSel.nStartPara < nParaCount && rSel.nEndPara < nParaCount)
+ return rSel.nStartPos >= 0 && rSel.nEndPos >= 0;
+ return false;
}
}