Check XRef's Catalog for being a Dict

Resolves: #2189820
This commit is contained in:
Marek Kasik 2023-06-09 16:39:24 +02:00
parent ac5cddc7c2
commit ba19ac39a7
2 changed files with 29 additions and 1 deletions

View File

@ -0,0 +1,21 @@
From dcd5bd8238ea448addd102ff045badd0aca1b990 Mon Sep 17 00:00:00 2001
From: crt <chluo@cse.cuhk.edu.hk>
Date: Wed, 27 Jul 2022 08:40:02 +0000
Subject: pdfseparate: Check XRef's Catalog for being a Dict
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 351140af..c26a41c4 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -886,6 +886,10 @@ int PDFDoc::savePageAs(const GooString &name, int pageNo)
// get and mark output intents etc.
Object catObj = getXRef()->getCatalog();
+ if (!catObj.isDict()) {
+ error(errSyntaxError, -1, "XRef's Catelog is not a dictionary");
+ return errOpenFile;
+ }
Dict *catDict = catObj.getDict();
Object pagesObj = catDict->lookup("Pages");
Object afObj = catDict->lookupNF("AcroForm").copy();

View File

@ -3,7 +3,7 @@
Summary: PDF rendering library
Name: poppler
Version: 21.01.0
Release: 17%{?dist}
Release: 18%{?dist}
License: (GPLv2 or GPLv3) and GPLv2+ and LGPLv2+ and MIT
URL: http://poppler.freedesktop.org/
Source0: http://poppler.freedesktop.org/poppler-%{version}.tar.xz
@ -44,6 +44,9 @@ Patch10: poppler-21.01.0-pdfunite-check-isDict.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2189814
Patch11: poppler-21.01.0-check-isDict.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=2189810
Patch12: poppler-21.01.0-XRef-check-isDict.patch
BuildRequires: make
BuildRequires: cmake
BuildRequires: gcc-c++
@ -237,6 +240,10 @@ test "$(pkg-config --modversion poppler-qt5)" = "%{version}"
%{_mandir}/man1/*
%changelog
* Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-18
- Check XRef's Catalog for being a Dict
- Resolves: #2189820
* Fri Jun 9 2023 Marek Kasik <mkasik@redhat.com> - 21.01.0-17
- Check isDict before calling getDict 2
- Resolves: #2189841