diff options
author | Eike Rathke <erack@redhat.com> | 2013-10-10 18:02:25 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2013-10-10 18:06:36 +0200 |
commit | b1caf176a44b6979d2e0ea47f495a3dacf86e197 (patch) | |
tree | d5645a546acbce945f93f155b8c95ff0b99feb36 /sc | |
parent | 541bb859332a790131ad3730fc87ec887266a18c (diff) |
fixed another "Out of bounds substring access"
Introduced with 3c2a26c84e70fd996855181d319970e2230b2459
Didn't have consequences here because the result was used to check for a
"startsWith" condition which it wouldn't had matched anyway. However,
use the real startsWith() now.
Change-Id: Ia1d558fc106d9a2010ad41c30f7eb2a2a480c59b
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/docshell/tablink.cxx | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/sc/source/ui/docshell/tablink.cxx b/sc/source/ui/docshell/tablink.cxx index 5a4cfcdf6fc7..b6255d1090ed 100644 --- a/sc/source/ui/docshell/tablink.cxx +++ b/sc/source/ui/docshell/tablink.cxx @@ -501,12 +501,11 @@ bool ScDocumentLoader::GetFilterName( const OUString& rFileName, void ScDocumentLoader::RemoveAppPrefix( OUString& rFilterName ) { - OUStringBuffer aAppPrefix; - aAppPrefix.appendAscii(STRING_SCAPP); - aAppPrefix.appendAscii(": "); - sal_Int32 nPreLen = aAppPrefix.getLength(); - if (rFilterName.copy(0, nPreLen).equals(aAppPrefix.makeStringAndClear())) - rFilterName = rFilterName.copy(nPreLen); + OUStringBuffer aBuf; + aBuf.appendAscii( STRING_SCAPP).appendAscii( ": "); + OUString aAppPrefix( aBuf.makeStringAndClear()); + if (rFilterName.startsWith( aAppPrefix)) + rFilterName = rFilterName.copy( aAppPrefix.getLength()); } ScDocumentLoader::ScDocumentLoader( const OUString& rFileName, |