Kaydet (Commit) 088b8988 authored tarafından Michael Stahl's avatar Michael Stahl

tdf#107709 filter: MSO2003XML import: fix invalid OLE lengths

The oleLength was -28160 for the bugdoc, so i guess the shifting of
signed chars there is perhaps not ideal, better upcast and
shift as unsigned.

Change-Id: I068013a10e18043c1534c7c61be8ff8a5556d460
üst db7bddbf
......@@ -117,8 +117,14 @@ namespace XSLT
{
return "Can not read the length.";
}
int oleLength = (aLength[0] << 0) + (aLength[1] << 8)
+ (aLength[2] << 16) + (aLength[3] << 24);
sal_Int32 const oleLength = (static_cast<sal_uInt8>(aLength[0]) << 0U)
| (static_cast<sal_uInt8>(aLength[1]) << 8U)
| (static_cast<sal_uInt8>(aLength[2]) << 16U)
| (static_cast<sal_uInt8>(aLength[3]) << 24U);
if (oleLength < 0)
{
return "invalid oleLength";
}
Sequence<sal_Int8> content(oleLength);
//Read all bytes. The compressed length should less then the uncompressed length
readbytes = subStream->readBytes(content, oleLength);
......
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