From ebb10f3256067c6e4ebea9a21a92d0199ac7fdf9 Mon Sep 17 00:00:00 2001 From: Jay Berkenbilt Date: Fri, 12 Jan 2024 07:11:46 -0500 Subject: Fix null pointer issue on array copy --- libqpdf/QPDF_Array.cc | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libqpdf') diff --git a/libqpdf/QPDF_Array.cc b/libqpdf/QPDF_Array.cc index c8cfe110..7d6f4539 100644 --- a/libqpdf/QPDF_Array.cc +++ b/libqpdf/QPDF_Array.cc @@ -1,5 +1,6 @@ #include +#include #include #include @@ -74,8 +75,10 @@ QPDF_Array::copy(bool shallow) if (shallow) { return do_create(new QPDF_Array(*this)); } else { + QTC::TC("qpdf", "QPDF_Array copy", sp ? 0 : 1); if (sp) { auto* result = new QPDF_Array(); + result->sp = std::make_unique(); result->sp->size = sp->size; for (auto const& element: sp->elements) { auto const& obj = element.second; -- cgit v1.2.3-54-g00ecf