[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Mon Jun 9 05:46:40 PDT 2014


 sw/source/filter/inc/rtf.hxx |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 8b208731bcd7257242f0e102873c8bc29f7003d6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Jun 9 13:24:25 2014 +0100

    valgrind: conditional jump depends on uninitialized data
    
    load abi10122-1.doc and save as rtf
    
    ==8717== Conditional jump or move depends on uninitialised value(s)
    ==8717==    at 0x4E741D5: rtl_str_valueOfInt32 (strtmpl.cxx:682)
    ==8717==    by 0x2C3B4C6D: rtl::OStringBuffer::append(int, short) (strbuf.hxx:594)
    ==8717==    by 0x2C3AF36A: RtfAttributeOutput::FormatSurround(SwFmtSurround const&) (rtfattributeoutput.cxx:2840)
    ==8717==    by 0x2C4EA31B: AttributeOutputBase::OutputItem(SfxPoolItem const&) (ww8atr.cxx:5426)
    ==8717==    by 0x2C4D6EF8: MSWordExportBase::OutputItemSet(SfxItemSet const&, bool, bool, unsigned short, bool) (ww8atr.cxx:303)
    ==8717==    by 0x2C4D8D0B: MSWordExportBase::OutputFormat(SwFmt const&, bool, bool, bool) (ww8atr.cxx:872)
    ==8717==    by 0x2C3A9636: RtfAttributeOutput::OutputFlyFrame_Impl(sw::Frame const&, Point const&) (rtfattributeoutput.cxx:1702)
    ==8717==    by 0x2C450C95: AttributeOutputBase::OutputFlyFrame(sw::Frame const&) (wrtw8nds.cxx:2970)
    
    Change-Id: I357e77f7a163fd9bb463d1a39f47381c23aa9eef

diff --git a/sw/source/filter/inc/rtf.hxx b/sw/source/filter/inc/rtf.hxx
index 0f9734d..73adefe 100644
--- a/sw/source/filter/inc/rtf.hxx
+++ b/sw/source/filter/inc/rtf.hxx
@@ -25,8 +25,9 @@ class RTFSurround
 {
     union {
         struct {
-            bool nGoldCut : 1;
-            sal_uInt16 nOrder : 4;
+            sal_uInt8 nGoldCut : 1;
+            sal_uInt8 nOrder : 4;
+            sal_uInt8 nJunk : 3;
         } Flags;
         sal_uInt8 nVal;
     } Value;
@@ -34,8 +35,9 @@ public:
     RTFSurround( sal_uInt8 nValue ) { Value.nVal = nValue; }
 
     RTFSurround( bool bGoldCut, sal_uInt8 nOrder ) {
-        Value.Flags.nOrder = nOrder;
         Value.Flags.nGoldCut = bGoldCut;
+        Value.Flags.nOrder = nOrder;
+        Value.Flags.nJunk = 0;
     }
 
     sal_uInt8  GetOrder()   const { return (sal_uInt8)Value.Flags.nOrder; }


More information about the Libreoffice-commits mailing list