diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-05-10 14:03:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-05-10 21:12:56 +0100 |
commit | cbe85c63d64d952696aa2643a07ce3af29555c57 (patch) | |
tree | bdb76b7422698a5bb47bde0be43ba6092605b625 /hwpfilter | |
parent | 9be0aaa9d7a489e8e828c4ff4ba665ceb8e5e167 (diff) |
coverity#707899 Uninitialized pointer field
Change-Id: Iacdd82589eb56bda653ceb84a0a6a2677f0aabd6
Diffstat (limited to 'hwpfilter')
-rw-r--r-- | hwpfilter/source/hinfo.cxx | 29 | ||||
-rw-r--r-- | hwpfilter/source/hinfo.h | 11 |
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 0b1a45e074d0..d3591b5ec68d 100644 --- a/hwpfilter/source/hinfo.h +++ b/hwpfilter/source/hinfo.h @@ -21,6 +21,7 @@ #define INCLUDED_HWPFILTER_SOURCE_HINFO_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)); + } +}; /* ???? ???? */ /** |