Skip to content

Commit

Permalink
Make sure ContentInfo::value_ is not null.
Browse files Browse the repository at this point in the history
This addresses the segfault case in the issue #1049
  • Loading branch information
romainthomas committed Apr 28, 2024
1 parent 41a9730 commit acd253f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/PE/signature/ContentInfo.cpp
Expand Up @@ -15,9 +15,9 @@
*/
#include "LIEF/Visitor.hpp"
#include "LIEF/PE/signature/ContentInfo.hpp"
#include "LIEF/PE/signature/GenericContent.hpp"
#include "LIEF/PE/EnumToString.hpp"
#include "LIEF/PE/signature/SpcIndirectData.hpp"
#include "LIEF/utils.hpp"

#include "Object.tcc"
#include "internal_utils.hpp"
Expand All @@ -27,13 +27,17 @@
namespace LIEF {
namespace PE {

ContentInfo::ContentInfo() = default;

ContentInfo::~ContentInfo() = default;

ContentInfo::Content::~Content() = default;

ContentInfo::ContentInfo(ContentInfo&& other) = default;

ContentInfo::ContentInfo() :
value_(std::make_unique<GenericContent>())
{}

ContentInfo::ContentInfo(const ContentInfo& other) :
Object::Object(other),
value_{other.value_->clone()}
Expand Down

0 comments on commit acd253f

Please sign in to comment.