diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-12-16 12:34:56 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-12-16 12:40:11 +0000 |
commit | 6d42e7a35b1b887e86a5f9b9eacd5e5b951df8bf (patch) | |
tree | 9b2fa138fc2d6113f0f16fa4a175a7f72cc0d646 /svx | |
parent | bee397a1e35fbc2717c56a8bd4a631ccfc185b6b (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
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/fmcomp/dbaexchange.cxx | 11 |
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); } // ----------------------------------------------------------------------------- |