summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-12-16 12:34:56 +0000
committerLionel Elie Mamane <lionel@mamane.lu>2013-12-17 20:35:06 +0100
commit444a8dd8752fe5e2cee58c5e51b7da7a4f5ff9f8 (patch)
tree650101594dd2096d3293f947ac905e47e1b585b6
parentb62c77d363aea607e35f65c06e9692a662195391 (diff)
fix out of range access
this is broken since 6e4a21ff22345a24e4d530725814c436a1bdd49a the original commit in 2001. I imagine the idea was to strip a trailing sal_Unicode(11) from the end of the string and then recalculate if the string is empty, but seeing as it has chugged away for the last 12+ years like this I'm relunctant to change it to what it might have originally been intended to do and instead just remove the stuff which was never executed. Change-Id: I73d5108ece8e716d78a4898117e0ee2d51822015
-rw-r--r--svx/source/fmcomp/dbaexchange.cxx11
1 files changed, 2 insertions, 9 deletions
diff --git a/svx/source/fmcomp/dbaexchange.cxx b/svx/source/fmcomp/dbaexchange.cxx
index e5a974d7023f..ff0e74f6584e 100644
--- a/svx/source/fmcomp/dbaexchange.cxx
+++ b/svx/source/fmcomp/dbaexchange.cxx
@@ -464,15 +464,8 @@ namespace svx
break;
}
- sal_Int32 nDescriptorLen = m_sCompatibleObjectDescription.getLength();
- if (nDescriptorLen)
- {
- if (m_sCompatibleObjectDescription[nDescriptorLen] == 11)
- m_sCompatibleObjectDescription = m_sCompatibleObjectDescription.copy(0, nDescriptorLen - 1);
-
- if (nDescriptorLen)
- AddFormat(SOT_FORMATSTR_ID_SBA_DATAEXCHANGE);
- }
+ if (!m_sCompatibleObjectDescription.isEmpty())
+ AddFormat(SOT_FORMATSTR_ID_SBA_DATAEXCHANGE);
}
// -----------------------------------------------------------------------------