2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-05-30 08:50:51 +00:00

Treat direct page as runtime rather than logic error (fuzz issue 27393)

This commit is contained in:
Jay Berkenbilt 2020-11-11 09:50:43 -05:00
parent a7ef572c84
commit bd79138c84
3 changed files with 11 additions and 3 deletions

View File

@ -1,3 +1,9 @@
2020-11-11 Jay Berkenbilt <ejb@ql.org>
* Treat a direct page object as a runtime error rather than a
logic error since it is actually possible to create a file that
has this (fuzz issue 27393).
2020-11-09 Jay Berkenbilt <ejb@ql.org> 2020-11-09 Jay Berkenbilt <ejb@ql.org>
* Handle "." appearing in --pages not preceded by a numeric range * Handle "." appearing in --pages not preceded by a numeric range

BIN
fuzz/qpdf_extra/27393.fuzz Normal file

Binary file not shown.

View File

@ -1512,9 +1512,11 @@ QPDFObjectHandle::coalesceContentStreams()
{ {
// Should not be possible for a page object to not have an // Should not be possible for a page object to not have an
// owning PDF unless it was manually constructed in some // owning PDF unless it was manually constructed in some
// incorrect way. // incorrect way. However, it can happen in a PDF file whose
throw std::logic_error("coalesceContentStreams called on object" // page structure is direct, which is against spec but still
" with no associated PDF file"); // possible to hand construct, as in fuzz issue 27393.
throw std::runtime_error("coalesceContentStreams called on object"
" with no associated PDF file");
} }
QPDFObjectHandle new_contents = newStream(qpdf); QPDFObjectHandle new_contents = newStream(qpdf);
this->replaceKey("/Contents", new_contents); this->replaceKey("/Contents", new_contents);