summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2022-08-12 17:39:18 +0200
committerCaolán McNamara <caolanm@redhat.com>2022-08-14 13:00:35 +0200
commitd484e8ba447de90fd77d0244a2cda1400bbe6232 (patch)
tree9098af1e7894f87b4f1d6aa4d4b7897e73f111cb
parentScriptForge - tdf#149983 dialog.EndExecute() failure (diff)
downloadcore-d484e8ba447de90fd77d0244a2cda1400bbe6232.tar.gz
core-d484e8ba447de90fd77d0244a2cda1400bbe6232.zip
sw: fix crash in InitBookmarks() with forum-mso-en-8410.docx
Error: attempt to dereference a past-the-end iterator. Probably this only crashes in the assert(iter->pNode...) as the rest of the function already checks that "iter == end". (regression from commit 46e04a712e97f9095ef4da7f0e52f50cf2bfbb32) Change-Id: If652a15d1cdebb21fbce028fceeaee8dce8f7f6d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138130 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/text/porlay.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 9db1949870d0..e96686f93fbd 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -1009,6 +1009,10 @@ static void InitBookmarks(
break;
}
}
+ if (iter == end)
+ {
+ break; // remaining marks are hidden
+ }
}
}