diff options
author | Eike Rathke <erack@redhat.com> | 2013-03-26 21:21:49 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-03-26 21:23:49 +0100 |
commit | b39975bc01a7a25393ff8ee95d8c9f453d2dfdd7 (patch) | |
tree | 16fd8728bc11e2b7c12d132548cd260d087ce1b8 /vcl | |
parent | 74364dad3fcacc32008f59fab2b5fd8aacd19c9d (diff) |
fixed out of bounds substring access
assuming is not good enough ...
Change-Id: Icd4f090fe94797ecf7e968855df3bb62609037c1
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 09836423f557..3558993a3a3d 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()) |