summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-05-10 14:03:22 +0100
committerAndras Timar <andras.timar@collabora.com>2015-03-20 12:34:15 +0100
commit7bf52dcde467c8213e0283915e2d762b7e452b8b (patch)
treea04fe92b5e3d32131e41da3df4d861cb9b8a83ec
parentccccc547eb380a2c78455d0ccfdfa2fbad2f6824 (diff)
coverity#707899 Uninitialized pointer field
Change-Id: Iacdd82589eb56bda653ceb84a0a6a2677f0aabd6 (cherry picked from commit cbe85c63d64d952696aa2643a07ce3af29555c57)
-rw-r--r--hwpfilter/source/hinfo.cxx29
-rw-r--r--hwpfilter/source/hinfo.h11
2 files changed, 33 insertions, 7 deletions
diff --git a/hwpfilter/source/hinfo.cxx b/hwpfilter/source/hinfo.cxx
index 2b8136218ce8..0068cf6ebbbc 100644
--- a/hwpfilter/source/hinfo.cxx
+++ b/hwpfilter/source/hinfo.cxx
@@ -37,14 +37,33 @@ static bool HWPReadInfoBlock(void *ptr, int len, HWPFile & hwpf)
// Document Information
-
-HWPInfo::HWPInfo(void)
+HWPInfo::HWPInfo()
+ : cur_col(0)
+ , cur_row(0)
+ , readonly(false)
+ , encrypted(false)
+ , beginpagenum(0)
+ , beginfnnum(0)
+ , countfn(0)
+ , splinetext(0)
+ , splinefn(0)
+ , spfnfn(0)
+ , fnchar(0)
+ , fnlinetype(0)
+ , borderline(0)
+ , empty_line_hide(0)
+ , table_move(0)
+ , compressed(0)
+ , reserved3(0)
+ , info_block_len(0)
+ , info_block(NULL)
{
- info_block = 0;
- back_info.isset = false;
+ back_info.isset = false;
+ memset(reserved1, 0, sizeof(reserved1));
+ memset(annotation, 0, sizeof(annotation));
+ memset(bordermargin, 0, sizeof(bordermargin));
}
-
HWPInfo::~HWPInfo(void)
{
if (info_block)
diff --git a/hwpfilter/source/hinfo.h b/hwpfilter/source/hinfo.h
index 44b08fbba392..74402f780349 100644
--- a/hwpfilter/source/hinfo.h
+++ b/hwpfilter/source/hinfo.h
@@ -21,6 +21,7 @@
#define _HWPINFO_H_
#include "hwplib.h"
+#include "string.h"
#define CHAIN_MAX_PATH 40
#define ANNOTATION_LEN 24
@@ -87,12 +88,18 @@ struct PaperBackInfo
/**
* Information of printing for chained page
*/
-typedef struct
+struct DocChainInfo
{
unsigned char chain_page_no;
unsigned char chain_footnote_no;
unsigned char chain_filename[CHAIN_MAX_PATH];
-} DocChainInfo;
+ DocChainInfo()
+ : chain_page_no(0)
+ , chain_footnote_no(0)
+ {
+ memset(chain_filename, 0, sizeof(chain_filename));
+ }
+};
/* ???? ???? */
/**