[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - embeddedobj/source

Caolán McNamara caolanm at redhat.com
Wed Jan 25 15:04:59 UTC 2017


 embeddedobj/source/msole/oleembed.cxx |   10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 56f2d3728b74e39b658cd1c59a55b4b338ea230d
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jan 23 10:50:10 2017 +0000

    Ole10Native payload truncated
    
    Change-Id: If2c0c2788e54eb01a1b6998c81df016061a0ad6b
    (cherry picked from commit da55a0e5158e14c3743b186d3b1d4022a278e4d5)
    Reviewed-on: https://gerrit.libreoffice.org/33450
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index c15962c..2faed0b 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -759,11 +759,11 @@ namespace
                 } while (nRead == 1 && aData[0] != 0);  // Actual string representing the file path
                 uno::Sequence< sal_Int8 > aLenData(4);
                 xIn->readBytes(aLenData, 4); //len of attachment
-                sal_uInt32 nLen = static_cast<sal_uInt32>
-                                              ((sal_uInt32)aLenData[0]
-                                            + ((sal_uInt32)aLenData[1] <<  8)
-                                            + ((sal_uInt32)aLenData[2] << 16)
-                                            + ((sal_uInt32)aLenData[3] << 24));
+                sal_uInt32 nLen = static_cast<sal_uInt32>(
+                                              (aLenData[0] & 0xFF) |
+                                              ((aLenData[1] & 0xFF) <<  8) |
+                                              ((aLenData[2] & 0xFF) << 16) |
+                                              ((aLenData[3] & 0xFF) << 24));
 
                 bCopied = lcl_CopyStream(xIn, xStream->getOutputStream(), nLen);
             }


More information about the Libreoffice-commits mailing list