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

Caolán McNamara caolanm at redhat.com
Tue Apr 15 12:12:48 PDT 2014


 filter/source/t602/t602filter.cxx |    8 ++++--
 filter/source/t602/t602filter.hxx |   50 +++++++++++++++++++++++++++++++++-----
 2 files changed, 50 insertions(+), 8 deletions(-)

New commits:
commit 95c802719aabaa1aa46519ae60c7b4ecea6016fc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sat Apr 12 14:43:05 2014 +0100

    coverity#707859 Uninitialized pointer field
    
    Change-Id: I1bc431746d9017db2ed2bbde797527e249804a1d

diff --git a/filter/source/t602/t602filter.cxx b/filter/source/t602/t602filter.cxx
index 98b6b25..5acdfc0 100644
--- a/filter/source/t602/t602filter.cxx
+++ b/filter/source/t602/t602filter.cxx
@@ -131,8 +131,12 @@ namespace T602ImportFilter {
 
 inistruct ini;
 
-T602ImportFilter::T602ImportFilter(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory > &r ) :
-    mxMSF( r ) {}
+T602ImportFilter::T602ImportFilter(const ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory > &r )
+    : mxMSF(r)
+    , mpAttrList(NULL)
+    , node(START)
+{
+}
 
 T602ImportFilter::~T602ImportFilter()
 {
diff --git a/filter/source/t602/t602filter.hxx b/filter/source/t602/t602filter.hxx
index 499b678..13b11a6 100644
--- a/filter/source/t602/t602filter.hxx
+++ b/filter/source/t602/t602filter.hxx
@@ -163,7 +163,8 @@ private:
 
     tnode node;         // START
 
-    struct {
+    struct format602struct
+    {
         sal_Int16   mt;       // row for header
         sal_Int16   mb;       // row for footer
         sal_Int16   tb;       // tabs
@@ -173,7 +174,21 @@ private:
         sal_Int16   lm;       // left border
         sal_Int16   rm;       // right border
         sal_Int16   pl;       // page length
-    } format602;
+        format602struct()
+            : mt(0)
+            , mb(0)
+            , tb(0)
+            , ct(0)
+            , pn(0)
+            , lh(0)
+            , lm(0)
+            , rm(0)
+            , pl(0)
+        {
+        }
+    };
+
+    format602struct format602;
 
     // Initialisation constants - they are not changed during the conversion
 
@@ -181,16 +196,27 @@ private:
 
     // Font state - changes based on font
 
-    struct {
+    struct fststruct
+    {
         fonts nowfnt;     // current font
         fonts oldfnt;     // previous font
         bool uline;       // underlined
         bool olduline;    // previous value of uline (font change)
-    } fst;
+        fststruct()
+            : nowfnt(standard)
+            , oldfnt(standard)
+            , uline(false)
+            , olduline(false)
+        {
+        }
+    };
+
+    fststruct fst;
 
     // Paragraph state
 
-    struct {
+    struct pststruct
+    {
         sal_Int16 pars;            //       the number of line endings times linespacing on the current page
         bool comment;        //       in comments
         sal_Int16 wasspace;        // 0     there was a space - for reformatting
@@ -198,7 +224,19 @@ private:
         bool ccafterln;      // false
         bool willbeeop;      // false
         bool waspar;         // false
-    } pst;
+        pststruct()
+            : pars(0)
+            , comment(false)
+            , wasspace(0)
+            , wasfdash(false)
+            , ccafterln(false)
+            , willbeeop(false)
+            , waspar(false)
+        {
+        }
+    };
+
+    pststruct pst;
 
     void Reset602();
     unsigned char Readchar602();


More information about the Libreoffice-commits mailing list