summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-10 16:17:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-10 18:50:37 +0200
commit36567d58115e21c111b45c011524ddbae540fd91 (patch)
treef64af94a8fb71b26dbf9980e6a658041e9699156 /sw
parentf0c8632056231ff4fb2d34e0c23b22c841f84d56 (diff)
fix zero at end of string in ExtractOLEClassName
this only worked by accident, because the only use of the string was to pass it to SvStream::WriteOString, which stops at the null byte Change-Id: Ief06db7b9c79943826da7bf377144e5244d328ee Reviewed-on: https://gerrit.libreoffice.org/80617 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/html/htmlreqifreader.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/filter/html/htmlreqifreader.cxx b/sw/source/filter/html/htmlreqifreader.cxx
index f065528da3a5..a42bff8188d6 100644
--- a/sw/source/filter/html/htmlreqifreader.cxx
+++ b/sw/source/filter/html/htmlreqifreader.cxx
@@ -89,7 +89,7 @@ OString ExtractOLEClassName(const tools::SvRef<SotStorage>& xStorage)
return aRet;
pCompObj->ReadUInt32(nData); // Reserved1
- return read_uInt8s_ToOString(*pCompObj, nData);
+ return read_uInt8s_ToOString(*pCompObj, nData - 1); // -1 because it is null-terminated
}
/// Parses the presentation stream of an OLE2 storage.
@@ -162,7 +162,7 @@ OString InsertOLE1Header(SvStream& rOle2, SvStream& rOle1, sal_uInt32& nWidth, s
rOle1.WriteUInt32(0x00000002);
// ClassName
- rOle1.WriteUInt32(aClassName.getLength());
+ rOle1.WriteUInt32(aClassName.isEmpty() ? 0 : aClassName.getLength() + 1);
if (!aClassName.isEmpty())
{
rOle1.WriteOString(aClassName);