[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/source

Kohei Yoshida kohei.yoshida at gmail.com
Wed Feb 6 06:38:51 PST 2013


 sc/source/core/tool/reffind.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 232b93e7f0e0ca90b54fe96d2c1adc5766d6706c
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Feb 5 15:23:44 2013 -0500

    fdo#39135: Prevent integer overflow & update the character during loop.
    
    These two errors in the code contributed to the reported bug.  Let's
    fix them.
    
    Change-Id: If82a1bd4d1e27145b48e722b30388cc9dc4a8a6e
    Reviewed-on: https://gerrit.libreoffice.org/2007
    Reviewed-by: Eike Rathke <erack at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/tool/reffind.cxx b/sc/source/core/tool/reffind.cxx
index 2fe76fc..c4621f0 100644
--- a/sc/source/core/tool/reffind.cxx
+++ b/sc/source/core/tool/reffind.cxx
@@ -155,15 +155,20 @@ void ExpandToTextR1C1(const sal_Unicode* p, xub_StrLen nLen, xub_StrLen& rStartP
                     if (c == '\'')
                         break;
                 }
+                if (rStartPos == 0)
+                    break;
             }
             else if (c == ']')
             {
                 // Skip until the opening braket.
                 for (--rStartPos; rStartPos > 0; --rStartPos)
                 {
+                    c = p[rStartPos];
                     if (c == '[')
                         break;
                 }
+                if (rStartPos == 0)
+                    break;
             }
             else if (!IsText(c))
             {


More information about the Libreoffice-commits mailing list