diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-04-01 21:31:12 +0100 |
---|---|---|
committer | Xisco Fauli <xiscofauli@libreoffice.org> | 2023-04-26 13:25:59 +0200 |
commit | 646ac8d55ec742da4ba1d34e9c4bc3217a279f60 (patch) | |
tree | efbc60ca5078587c0a6c7922a120dc78dab3e19e | |
parent | tdf#154789 EMF+ Performance boost of the EmfPlusRecordTypeDrawBeziers (diff) | |
download | core-646ac8d55ec742da4ba1d34e9c4bc3217a279f60.tar.gz core-646ac8d55ec742da4ba1d34e9c4bc3217a279f60.zip |
ofz#57592 Null-dereference READ
Change-Id: I6fc96bb0be6c5a872861987a195b0d628f574c46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149918
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 484fa53f43977e390bf79831cf7096983a440cff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150557
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
(cherry picked from commit 748c1400a4408ad875d72044bb635524cfeddf4d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150561
Reviewed-by: Stéphane Guillou <stephane.guillou@libreoffice.org>
Tested-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r-- | sw/qa/core/data/ww8/pass/ofz57592-1.doc | bin | 0 -> 42913 bytes | |||
-rw-r--r-- | sw/source/core/doc/DocumentContentOperationsManager.cxx | 17 |
2 files changed, 10 insertions, 7 deletions
diff --git a/sw/qa/core/data/ww8/pass/ofz57592-1.doc b/sw/qa/core/data/ww8/pass/ofz57592-1.doc Binary files differnew file mode 100644 index 000000000000..289343a1afb7 --- /dev/null +++ b/sw/qa/core/data/ww8/pass/ofz57592-1.doc diff --git a/sw/source/core/doc/DocumentContentOperationsManager.cxx b/sw/source/core/doc/DocumentContentOperationsManager.cxx index 21f67d9a9774..a87dc20f8516 100644 --- a/sw/source/core/doc/DocumentContentOperationsManager.cxx +++ b/sw/source/core/doc/DocumentContentOperationsManager.cxx @@ -626,18 +626,21 @@ namespace sw } while (!startedFields.empty()) { - SwPosition const& rStart(std::get<0>(startedFields.top())->GetMarkStart()); - std::pair<SwNodeOffset, sal_Int32> const pos( - rStart.GetNodeIndex(), rStart.GetContentIndex()); - auto it = std::lower_bound(rBreaks.begin(), rBreaks.end(), pos); - assert(it == rBreaks.end() || *it != pos); - rBreaks.insert(it, pos); + if (const sw::mark::IFieldmark* pMark = std::get<0>(startedFields.top())) + { + SwPosition const& rStart(pMark->GetMarkStart()); + std::pair<SwNodeOffset, sal_Int32> const pos( + rStart.GetNodeIndex(), rStart.GetContentIndex()); + auto it = std::lower_bound(rBreaks.begin(), rBreaks.end(), pos); + assert(it == rBreaks.end() || *it != pos); + rBreaks.insert(it, pos); + } if (std::get<1>(startedFields.top())) { std::pair<SwNodeOffset, sal_Int32> const posSep( std::get<2>(startedFields.top()), std::get<3>(startedFields.top())); - it = std::lower_bound(rBreaks.begin(), rBreaks.end(), posSep); + auto it = std::lower_bound(rBreaks.begin(), rBreaks.end(), posSep); assert(it == rBreaks.end() || *it != posSep); rBreaks.insert(it, posSep); } |