[Libreoffice-commits] core.git: sc/source

Caolán McNamara caolanm at redhat.com
Wed Nov 6 14:19:50 CET 2013


 sc/source/core/tool/compiler.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c7332236cdf059645ec206b890d7975cf965da54
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Nov 6 13:18:52 2013 +0000

    don't access beyond end of string
    
    as shown by assert in fdo37872-1
    
    Change-Id: Iccc27b7898a72a0f580c0e8996c8e69de7ea8842

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 45485c3..62bf259 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2606,7 +2606,7 @@ bool ScCompiler::IsPredetectedReference(const OUString& rName)
                 return false;       // $#REF!.AB42 or $#REF!42 or $#REF!#REF!
             c = rName[nPos-2];              // before $#REF!
         }
-        sal_Unicode c2 = rName[nPos+5];     // after #REF!
+        sal_Unicode c2 = nPos+5 < rName.getLength() ? rName[nPos+5] : 0;     // after #REF!
         switch (c)
         {
             case '.':


More information about the Libreoffice-commits mailing list