Kaydet (Commit) 644678e2 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Avoid left shift of negative values (ubsan)

Change-Id: If465c155c70ec068b6bd7adc05f188bbecc2824e
üst 413210a5
......@@ -469,13 +469,13 @@ void XclExpSheetProtection::SaveXml( XclExpXmlStream& rStrm )
if ( pTabProtect )
{
Sequence<sal_Int8> aHash = pTabProtect->getPasswordHash(PASSHASH_XL);
sal_uInt16 nHash(0x0000);
OString sHash;
if (aHash.getLength() >= 2)
{
nHash = ((aHash[0] << 8) & 0xFFFF);
nHash |= (aHash[1] & 0xFF);
sHash = OString::number( nHash, 16 );
sHash = OString::number(
( static_cast<sal_uInt8>(aHash[0]) << 8
| static_cast<sal_uInt8>(aHash[1]) ),
16 );
}
sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
rWorksheet->singleElement( XML_sheetProtection,
......
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