[Libreoffice-commits] core.git: sd/source
Caolán McNamara
caolanm at redhat.com
Fri Sep 18 05:12:59 PDT 2015
sd/source/filter/ppt/propread.cxx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit f6368c29bdc3a9017bcae3f064d2cd8c7e37ed10
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Sep 18 13:11:46 2015 +0100
if nSize was 1 with unicode encoding
nSize would wrap around in lcl_getMaxSafeStrLen
Change-Id: Ie99d4abc271a6fe72b256a6bfe0757609e9523f9
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index 9fd2501..b76fbca 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -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]);
More information about the Libreoffice-commits
mailing list