sw/source/core/crsr/bookmark.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
New commits: commit cf636728b6bfbd8f5992e5a4393496fb411c5b8c Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Sun Nov 27 16:29:51 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sun Nov 27 20:14:52 2022 +0100 cid#1517056 Dereference after null check Change-Id: I9615e8a762b646d9b9567db56c0d59c61daa010f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143349 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sw/source/core/crsr/bookmark.cxx b/sw/source/core/crsr/bookmark.cxx index a05e4024db9c..feb7e77a3163 100644 --- a/sw/source/core/crsr/bookmark.cxx +++ b/sw/source/core/crsr/bookmark.cxx @@ -821,7 +821,8 @@ namespace sw::mark aList.insert(aList.begin() + nNewPos, rText); else { - *pIndex = nLen; + if (pIndex) + *pIndex = nLen; aList.push_back(rText); }