Kaydet (Commit) aebcabd5 authored tarafından Eike Rathke's avatar Eike Rathke

out-of-bounds string access, this comparison never matched

aName == aLinkTabName.copy(nIndex, nLinkTabNameLength)
is not a replacement for
String(aName).Equals(String(aLinkTabName), nIndex, nLinkTabNameLength)
instead use
aName.match( aLinkTabName, nIndex)
because here nLinkTabNameLength actually is aLinkTabName.getLength()

Change-Id: I884f56541f819db5672e9d096a26a3673e82d83b
üst dfb48f77
...@@ -318,7 +318,7 @@ void ScDocShell::AfterXMLLoading(bool bRet) ...@@ -318,7 +318,7 @@ void ScDocShell::AfterXMLLoading(bool bRet)
{ {
sal_Int32 nIndex = nNameLength - nLinkTabNameLength; sal_Int32 nIndex = nNameLength - nLinkTabNameLength;
INetURLObject aINetURLObject(aDocURLBuffer.makeStringAndClear()); INetURLObject aINetURLObject(aDocURLBuffer.makeStringAndClear());
if(aName == aLinkTabName.copy(nIndex, nLinkTabNameLength) && if(aName.match( aLinkTabName, nIndex) &&
(aName[nIndex - 1] == '#') && // before the table name should be the # char (aName[nIndex - 1] == '#') && // before the table name should be the # char
!aINetURLObject.HasError()) // the docname should be a valid URL !aINetURLObject.HasError()) // the docname should be a valid URL
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment