Kaydet (Commit) f6368c29 authored tarafından Caolán McNamara's avatar Caolán McNamara

if nSize was 1 with unicode encoding

nSize would wrap around in lcl_getMaxSafeStrLen

Change-Id: Ie99d4abc271a6fe72b256a6bfe0757609e9523f9
üst 8523e57e
......@@ -289,6 +289,8 @@ void Section::GetDictionary(Dictionary& rDict)
{
sal_uInt32 nId(0), nSize(0);
aStream.ReadUInt32( nId ).ReadUInt32( nSize );
if (mnTextEnc == RTL_TEXTENCODING_UCS2)
nSize >>= 1;
if (!nSize)
continue;
OUString aString;
......@@ -296,7 +298,6 @@ void Section::GetDictionary(Dictionary& rDict)
{
if ( mnTextEnc == RTL_TEXTENCODING_UCS2 )
{
nSize >>= 1;
sal_Unicode* pWString = new sal_Unicode[nSize];
for (sal_uInt32 j = 0; j < nSize; ++j)
aStream.ReadUInt16(pWString[j]);
......
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