summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2014-06-21 22:33:17 +0200
committerJulien Nabet <serval2412@yahoo.fr>2014-06-21 22:33:17 +0200
commitd59da701c67074a44abcfebcb7506792d12127ae (patch)
treef26d26adbd94851b057fdbfb0acadda3ca7c4ad5 /scripting
parente4ca1f900a5585d35af04159bdd854f10b495355 (diff)
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 Change-Id: I944a852d6cc9a35c451985ac96032f0d848136e8
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/stringresource/stringresource.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index 15335314a936..c0b2e71b6d0f 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -1722,7 +1722,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 );