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

Caolán McNamara caolanm at redhat.com
Mon Jan 6 08:05:49 PST 2014


 sc/source/ui/optdlg/tpusrlst.cxx |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit c41e98e9ec3026c62424420e4910bd9a0470fbb7
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 6 15:24:23 2014 +0000

    avoid out of bounds string access
    
    Change-Id: I0a0affea08528fc9bd729ab01cdb5fa6e9f8e18f
    (cherry picked from commit 8c0bb201382d839124fb9a9c8906e2c2018a6939)

diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index 2b986ce..89c9d19 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -333,14 +333,14 @@ void ScTpUserLists::MakeListStr( OUString& rListStr )
     while ( c < nLen )
     {
         rListStr += OUString(aStr[c]);
-        c++;
+        ++c;
 
-        if ( aStr[c] == cDelimiter )
+        if ((c < nLen) && (aStr[c] == cDelimiter))
         {
             rListStr += OUString(aStr[c]);
 
-            while ( (c < nLen) && (aStr[c] == cDelimiter) )
-                c++;
+            while ((c < nLen) && (aStr[c] == cDelimiter))
+                ++c;
         }
     }
 


More information about the Libreoffice-commits mailing list