diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2015-10-26 14:25:26 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-01-21 12:00:36 +0100 |
commit | 11f71656025763073c2167bce0e86b727704990e (patch) | |
tree | 48d75a1b3a01a2fd904eb3bb3039b427f04a7b50 | |
parent | c42b529e8508d355e8d87b5b90f76f3b32ba36d5 (diff) |
gtktiledviwer: try to paste as html, then as plain text
This commit (as a side effect) fixes LOKTransferable::getTransferData()
to not assume that the string is null-terminated, so it makes sense to
backport it even without gtktiledviewer. Otherwise rtl_str_getLength()
will read memory up till it finds a 0 byte, so it might read
uninitialized memory -> garbage at the end of the string.
(cherry picked from commit 080bd44f0b0300075ff18d377f31deebbc4009ed)
Conflicts:
libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
Change-Id: I8e1c93fd36fb903c0625b29f9f73825438c9e113
-rw-r--r-- | desktop/source/lib/lokclipboard.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/desktop/source/lib/lokclipboard.cxx b/desktop/source/lib/lokclipboard.cxx index 50d570577e27..376bcd72d238 100644 --- a/desktop/source/lib/lokclipboard.cxx +++ b/desktop/source/lib/lokclipboard.cxx @@ -43,7 +43,7 @@ throw(datatransfer::UnsupportedFlavorException, io::IOException, uno::RuntimeExc if (rFlavor.DataType == cppu::UnoType<OUString>::get()) { sal_Char* pText = reinterpret_cast<sal_Char*>(m_aSequence.getArray()); - aRet <<= OUString(pText, rtl_str_getLength(pText), RTL_TEXTENCODING_UTF8); + aRet <<= OUString(pText, m_aSequence.getLength(), RTL_TEXTENCODING_UTF8); } else aRet <<= m_aSequence; |