[Libreoffice-commits] core.git: vcl/unx

Eike Rathke erack at redhat.com
Tue Mar 26 13:24:14 PDT 2013


 vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit b39975bc01a7a25393ff8ee95d8c9f453d2dfdd7
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Mar 26 21:21:49 2013 +0100

    fixed out of bounds substring access
    
    assuming is not good enough ...
    
    Change-Id: Icd4f090fe94797ecf7e968855df3bb62609037c1

diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
index 0983642..3558993 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx
@@ -1851,7 +1851,9 @@ GtkFileFilter* SalGtkFilePicker::implAddFilter( const OUString& rFilter, const O
         {
             aToken = rType.getToken( 0, ';', nIndex );
             // Assume all have the "*.<extn>" syntax
-            aToken = aToken.copy( aToken.lastIndexOf( aStarDot ) + 2 );
+            sal_Int32 nStarDot = aToken.lastIndexOf( aStarDot );
+            if (nStarDot >= 0)
+                aToken = aToken.copy( nStarDot + 2 );
             if (!aToken.isEmpty())
             {
                 if (!aTokens.isEmpty())


More information about the Libreoffice-commits mailing list