include/editeng/unotext.hxx |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit a46ff530d4cf3d7d87fc58f0c9201949b8cb832d
Author: Caolán McNamara <caol...@redhat.com>
Date:   Thu Jan 18 12:52:30 2018 +0000

    ofz#5471 Null-dereference READ
    
    Change-Id: I5af76b87c3793c7ec7ac41ab25bb4de5d81fc3cf
    Reviewed-on: https://gerrit.libreoffice.org/48123
    Reviewed-by: Caolán McNamara <caol...@redhat.com>
    Tested-by: Caolán McNamara <caol...@redhat.com>

diff --git a/include/editeng/unotext.hxx b/include/editeng/unotext.hxx
index 73e2afdf366d..4ee3bf4fc11d 100644
--- a/include/editeng/unotext.hxx
+++ b/include/editeng/unotext.hxx
@@ -309,7 +309,12 @@ protected:
 
 public:
     // Internal
-    const ESelection&       GetSelection() const throw() { CheckSelection( 
const_cast<SvxUnoTextRangeBase*>(this)->maSelection, 
mpEditSource->GetTextForwarder() ); return maSelection; };
+    const ESelection& GetSelection() const throw()
+    {
+        const SvxTextForwarder* pForwarder = mpEditSource ? 
mpEditSource->GetTextForwarder() : nullptr;
+        CheckSelection(const_cast<SvxUnoTextRangeBase*>(this)->maSelection, 
pForwarder);
+        return maSelection;
+    }
     void                    SetSelection( const ESelection& rSelection ) 
throw();
 
     void            CollapseToStart() throw();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to