Skip to content

Commit

Permalink
Bug 707944: Check current history position stated in journal.
Browse files Browse the repository at this point in the history
Previously this values was not boundary checked, possibly causing
a crash for out of range values.

Thanks to Piotr Kajda for proposing this patch.
  • Loading branch information
sebras committed Sep 2, 2024
1 parent b5c898a commit d418c97
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/pdf/pdf-object.c
Original file line number Diff line number Diff line change
Expand Up @@ -1721,6 +1721,9 @@ void pdf_deserialise_journal(fz_context *ctx, pdf_document *doc, fz_stream *stm)
doc->journal->current = NULL;
if (pos > 0)
{
if (doc->journal->head == NULL)
fz_throw(ctx, FZ_ERROR_FORMAT, "Badly formed journal");

doc->journal->current = doc->journal->head;
while (--pos)
{
Expand Down

0 comments on commit d418c97

Please sign in to comment.