Commit 6a4117add996eeaaf330bd700e30380295daab93

Authored by Jay Berkenbilt
1 parent 4f3b8999

Avoid potential segfault in warning methods

Showing 1 changed file with 2 additions and 0 deletions
libqpdf/QPDFObjectHandle.cc
... ... @@ -2652,6 +2652,7 @@ QPDFObjectHandle::typeWarning(char const* expected_type,
2652 2652 {
2653 2653 QPDF* context = 0;
2654 2654 std::string description;
  2655 + dereference();
2655 2656 if (this->obj->getDescription(context, description))
2656 2657 {
2657 2658 warn(context,
... ... @@ -2674,6 +2675,7 @@ QPDFObjectHandle::warnIfPossible(std::string const& warning,
2674 2675 {
2675 2676 QPDF* context = 0;
2676 2677 std::string description;
  2678 + dereference();
2677 2679 if (this->obj->getDescription(context, description))
2678 2680 {
2679 2681 warn(context,
... ...