[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - scripting/source
Julien Nabet
serval2412 at yahoo.fr
Mon Jun 23 02:06:26 PDT 2014
scripting/source/stringresource/stringresource.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 69987ea99a722cb4b3e2df3132b89bacd0a5b862
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Sat Jun 21 22:33:17 2014 +0200
Related fdo#58774 Alternative dialog Find & Replace for Writer
After having installed the extension from http://extensions.libreoffice.org/extension-center/alternative-dialog-find-replace-for-writer/releases/1.4
I had a crash, extract of bt:
5 0x00002aaad3ee13df in rtl::OUString::copy (this=0x7fffffff2510, beginIndex=147, count=-15) at /home/julien/compile-libreoffice/libreoffice/include/rtl/ustring.hxx:1481
6 0x00002aaad3edc10e in stringresource::StringResourcePersistenceImpl::implScanLocaleNames (this=0x8e2bba0, aContentSeq=uno::Sequence of length 24 = {...})
at /home/julien/compile-libreoffice/libreoffice/scripting/source/stringresource/stringresource.cxx:1728
So add a quick check to be sure iDot > iSlash
Cherry-picked from d59da701c67074a44abcfebcb7506792d12127ae
Change-Id: I944a852d6cc9a35c451985ac96032f0d848136e8
Reviewed-on: https://gerrit.libreoffice.org/9848
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index ce814ef..f245f02 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -1727,7 +1727,7 @@ void StringResourcePersistenceImpl::implScanLocaleNames( const Sequence< OUStrin
OUString aExtension;
sal_Int32 iDot = aCompleteName.lastIndexOf( '.' );
sal_Int32 iSlash = aCompleteName.lastIndexOf( '/' );
- if( iDot != -1 )
+ if( iDot != -1 && iDot > iSlash)
{
sal_Int32 iCopyFrom = (iSlash != -1) ? iSlash + 1 : 0;
aPureName = aCompleteName.copy( iCopyFrom, iDot-iCopyFrom );
More information about the Libreoffice-commits
mailing list