xfile: fix read from uninitialized memory (see #554)

This commit is contained in:
rdb 2019-02-12 15:40:31 +01:00
parent 6640e5698d
commit 094458a8df
3 changed files with 14 additions and 1 deletions

View File

@ -34,7 +34,7 @@ PT(XFile) XFile::_standard_templates;
* *
*/ */
XFile:: XFile::
XFile(bool keep_names) : XFileNode(this, "") { XFile(bool keep_names) : XFileNode(this) {
_major_version = 3; _major_version = 3;
_minor_version = 2; _minor_version = 2;
_format_type = FT_text; _format_type = FT_text;

View File

@ -11,6 +11,16 @@
* @date 2004-10-03 * @date 2004-10-03
*/ */
/**
*
*/
INLINE XFileNode::
XFileNode(XFile *x_file) :
Namable(),
_x_file(x_file)
{
}
/** /**
* *
*/ */

View File

@ -38,6 +38,9 @@ class Filename;
*/ */
class XFileNode : public TypedObject, public Namable, class XFileNode : public TypedObject, public Namable,
virtual public ReferenceCount { virtual public ReferenceCount {
protected:
INLINE XFileNode(XFile *x_file);
public: public:
XFileNode(XFile *x_file, const std::string &name); XFileNode(XFile *x_file, const std::string &name);
virtual ~XFileNode(); virtual ~XFileNode();