summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2023-01-20 09:21:46 +0000
committerMichael Stahl <michael.stahl@allotropia.de>2023-01-24 13:07:27 +0000
commitfaa3ef712fc745774914d1f409877589551926bc (patch)
tree86e6bed00f8d577dcd53f62e1a20a3c191cb2073
parentResolves: tdf#153049 cell range not expanding while scrolling (diff)
downloadcore-faa3ef712fc745774914d1f409877589551926bc.tar.gz
core-faa3ef712fc745774914d1f409877589551926bc.zip
Resolves: tdf#153116 null-ptr-deref in get-surrounding-text
#0 SwFrame::IsTextFrame() const (this=0x0) at sw/source/core/inc/frame.hxx:1236 #1 0x00007fffa8dcb865 in sw::FrameContainsNode(SwContentFrame const&, o3tl::strong_int<int, Tag_SwNodeOffset>) (rFrame=..., nNodeIndex=...) at sw/source/core/text/txtfrm.cxx:292 #2 0x00007fffa82c9fd4 in SwCursorShell::GetSelText() const (this=0x5509470) at sw/source/core/crsr/crsrsh.cxx:2565 #3 0x00007fffa89017f0 in SwEditShell::GetSelectedText(rtl::OUString&, ParaBreakType) (this=0x5509470, rBuf="", nHndlParaBrk=ParaBreakType::ToOnlyCR) at sw/source/core/edit/edglss.cxx:264 #4 0x00007fffa97e19a7 in SwEditWin::GetSurroundingText() const (this=0x4f1a9f0) at sw/source/uibase/docvw/edtwin.cxx:6628 #5 0x00007fffee27cf02 in ImplHandleSurroundingTextRequest(vcl::Window*, rtl::OUString&, Selection&) (pWindow=0x1fe43f0, rText="", rSelRange=...) at vcl/source/window/winproc.cxx:2544 #6 0x00007fffee27adf7 in ImplHandleSalSurroundingTextRequest(vcl::Window*, SalSurroundingTextRequestEvent*) (pWindow=0x1fe43f0, pEvt=0x7fffffffb970) at vcl/source/window/winproc.cxx:2555 #7 0x00007fffee276ed6 in ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) (_pWindow=0x1fe43f0, nEvent=SalEvent::SurroundingTextRequest, pEvent=0x7fffffffb970) at vcl/source/window/winproc.cxx:2884 #8 0x00007fffe6ee3080 in SalFrame::CallCallback(SalEvent, void const*) const (this=0x1898310, nEvent=SalEvent::SurroundingTextRequest, pEvent=0x7fffffffb970) at vcl/inc/salframe.hxx:306 Change-Id: I7330865b5dda7766a6da08f57a7dd8dd1a09d198 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146016 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com> Tested-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--sw/source/core/crsr/crsrsh.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 725c7ede3402..b270cdbe6334 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -2562,7 +2562,7 @@ OUString SwCursorShell::GetSelText() const
if (GetLayout()->HasMergedParas())
{
SwContentFrame const*const pFrame(GetCurrFrame(false));
- if (FrameContainsNode(*pFrame, m_pCurrentCursor->GetMark()->GetNodeIndex()))
+ if (pFrame && FrameContainsNode(*pFrame, m_pCurrentCursor->GetMark()->GetNodeIndex()))
{
OUStringBuffer buf;
SwPosition const*const pStart(m_pCurrentCursor->Start());