From fb1ca5756134c3a6a16b013a9b147a4202d40cb4 Mon Sep 17 00:00:00 2001 From: Renbo Date: Mon, 19 Aug 2024 17:30:21 +0800 Subject: [PATCH 1/2] update to poppler-20.11.0-12.src.rpm Signed-off-by: Renbo --- dist | 2 +- poppler-20.11.0-pdfinfo-dests.patch | 110 ++++++++++++++++++++++++++++ poppler.spec | 35 ++++----- 3 files changed, 126 insertions(+), 21 deletions(-) create mode 100644 poppler-20.11.0-pdfinfo-dests.patch diff --git a/dist b/dist index 9c0e36e..1fe92cf 100644 --- a/dist +++ b/dist @@ -1 +1 @@ -an8 +an8_10 diff --git a/poppler-20.11.0-pdfinfo-dests.patch b/poppler-20.11.0-pdfinfo-dests.patch new file mode 100644 index 0000000..20889c1 --- /dev/null +++ b/poppler-20.11.0-pdfinfo-dests.patch @@ -0,0 +1,110 @@ +From 0554731052d1a97745cb179ab0d45620589dd9c4 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Fri, 7 Jun 2024 00:54:55 +0200 +Subject: pdfinfo: Fix crash in broken documents when using -dests + +Modified by Marek Kasik due to the backport. + +diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc +index 5d37ef64..7d569749 100644 +--- a/utils/pdfinfo.cc ++++ b/utils/pdfinfo.cc +@@ -15,7 +15,7 @@ + // under GPL version 2 or later + // + // Copyright (C) 2006 Dom Lachowicz +-// Copyright (C) 2007-2010, 2012, 2016-2020 Albert Astals Cid ++// Copyright (C) 2007-2010, 2012, 2016-2020, 2024 Albert Astals Cid + // Copyright (C) 2010 Hib Eris + // Copyright (C) 2011 Vittal Aithal + // Copyright (C) 2012, 2013, 2016-2018 Adrian Johnson +@@ -107,6 +107,23 @@ static const ArgDesc argDesc[] = { { "-f + { "-?", argFlag, &printHelp, 0, "print usage information" }, + {} }; + ++static void printStdTextString(const std::string &s, const UnicodeMap *uMap) ++{ ++ char buf[8]; ++ Unicode *u; ++ int i, len; ++ GooString *s1 = new GooString(s); ++ ++ if (s1 != nullptr) { ++ len = TextStringToUCS4(s1, &u); ++ for (i = 0; i < len; i++) { ++ int n = uMap->mapUnicode(u[i], buf, sizeof(buf)); ++ fwrite(buf, 1, n, stdout); ++ } ++ delete s1; ++ } ++} ++ + static void printInfoString(Dict *infoDict, const char *key, const char *text, const UnicodeMap *uMap) + { + const GooString *s1; +@@ -278,11 +295,6 @@ static void printStruct(const StructElem + } + } + +-struct GooStringCompare +-{ +- bool operator()(GooString *lhs, GooString *rhs) const { return lhs->cmp(const_cast(rhs)) < 0; } +-}; +- + static void printLinkDest(const std::unique_ptr &dest) + { + GooString s; +@@ -353,29 +365,25 @@ static void printLinkDest(const std::uni + + static void printDestinations(PDFDoc *doc, const UnicodeMap *uMap) + { +- std::map, GooStringCompare>> map; ++ std::map>> map; + + int numDests = doc->getCatalog()->numDestNameTree(); + for (int i = 0; i < numDests; i++) { +- GooString *name = new GooString(doc->getCatalog()->getDestNameTreeName(i)); ++ const GooString *name = doc->getCatalog()->getDestNameTreeName(i); + std::unique_ptr dest = doc->getCatalog()->getDestNameTreeDest(i); +- if (dest && dest->isPageRef()) { ++ if (name && dest && dest->isPageRef()) { + Ref pageRef = dest->getPageRef(); +- map[pageRef].insert(std::make_pair(name, std::move(dest))); +- } else { +- delete name; ++ map[pageRef].insert(std::make_pair(name->toStr(), std::move(dest))); + } + } + + numDests = doc->getCatalog()->numDests(); + for (int i = 0; i < numDests; i++) { +- GooString *name = new GooString(doc->getCatalog()->getDestsName(i)); ++ const char *name = doc->getCatalog()->getDestsName(i); + std::unique_ptr dest = doc->getCatalog()->getDestsDest(i); +- if (dest && dest->isPageRef()) { ++ if (name && dest && dest->isPageRef()) { + Ref pageRef = dest->getPageRef(); + map[pageRef].insert(std::make_pair(name, std::move(dest))); +- } else { +- delete name; + } + } + +@@ -389,16 +397,8 @@ static void printDestinations(PDFDoc *do + printf("%4d ", i); + printLinkDest(it.second); + printf(" \""); +- Unicode *u; +- char buf[8]; +- const int len = TextStringToUCS4(it.first, &u); +- for (int j = 0; j < len; j++) { +- const int n = uMap->mapUnicode(u[j], buf, sizeof(buf)); +- fwrite(buf, 1, n, stdout); +- } +- gfree(u); ++ printStdTextString(it.first, uMap); + printf("\"\n"); +- delete it.first; + } + } + } diff --git a/poppler.spec b/poppler.spec index c4aedcd..8977e88 100644 --- a/poppler.spec +++ b/poppler.spec @@ -1,11 +1,10 @@ -%define anolis_release .0.2 %global test_sha 0d2bfd4af4c76a3bac27ccaff793d9129df7b57a %global test_date 2009-05-13 Summary: PDF rendering library Name: poppler Version: 20.11.0 -Release: 10%{anolis_release}%{?dist} +Release: 12%{?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 @@ -46,8 +45,12 @@ Patch28: poppler-20.11.0-check-isDict.patch # https://bugzilla.redhat.com/show_bug.cgi?id=2189810 Patch29: poppler-20.11.0-XRef-check-isDict.patch +# https://issues.redhat.com/browse/RHEL-4255 Patch30: poppler-20.11.0-fix-crash-in-FoFiType1C.patch +# https://issues.redhat.com/browse/RHEL-44330 +Patch31: poppler-20.11.0-pdfinfo-dests.patch + BuildRequires: cmake BuildRequires: gettext-devel BuildRequires: pkgconfig(cairo) @@ -76,7 +79,6 @@ BuildRequires: pkgconfig(Qt5Test) BuildRequires: pkgconfig(Qt5Widgets) BuildRequires: pkgconfig(Qt5Xml) BuildRequires: python3-devel -BuildRequires: mesa-libEGL-devel Requires: poppler-data @@ -152,14 +154,6 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Command line tools for manipulating PDF files and converting them to other formats. -%package doc -Summary: Documents for %{name} -BuildArch: noarch -Requires: %{name} = %{version}-%{release} - -%description doc -Doc pages for %{name}. - %prep %autosetup -p1 -b 1 chmod -x poppler/CairoFontEngine.cc @@ -210,6 +204,7 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %postun cpp -p /sbin/ldconfig %files +%doc README.md %license COPYING %{_libdir}/libpoppler.so.104* @@ -259,18 +254,18 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %{_bindir}/pdf* %{_mandir}/man1/* -%files doc -%doc README.md - %changelog -* Fri Jun 07 2024 lutw - 21.01.0-10.0.2 -- Fix CVE-2020-36024 +* Fri Jul 26 2024 Marek Kasik - 20.11.0-12 +- Fix crash in broken documents when using -dests +- Fix versions in changelog +- Resolves: RHEL-44330 -* Fri Dec 08 2023 liuzhilin - 21.01.0-10.0.1 -- Add doc sub package -- Add BR mesa-libEGL-devel +* Thu Oct 12 2023 Marek Kasik - 20.11.0-11 +- Fix crashes in FoFiType1C +- Rebuild for inclusion of poppler-glib-doc in CRB +- Resolves: RHEL-4255, RHEL-4273 -* Fri Jun 9 2023 Marek Kasik - 21.01.0-10 +* Fri Jun 9 2023 Marek Kasik - 20.11.0-10 - Check XRef's Catalog for being a Dict - Resolves: #2189816 -- Gitee From d2aaadd6d589bb8825b1254cd07d66a8b97b4cb6 Mon Sep 17 00:00:00 2001 From: Weisson Date: Tue, 19 Jul 2022 17:01:19 +0800 Subject: [PATCH 2/2] spec: add doc sub package Signed-off-by: Weisson --- poppler.spec | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/poppler.spec b/poppler.spec index 8977e88..0be32fd 100644 --- a/poppler.spec +++ b/poppler.spec @@ -1,10 +1,11 @@ +%define anolis_release .0.1 %global test_sha 0d2bfd4af4c76a3bac27ccaff793d9129df7b57a %global test_date 2009-05-13 Summary: PDF rendering library Name: poppler Version: 20.11.0 -Release: 12%{?dist} +Release: 12%{anolis_release}%{?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 @@ -81,6 +82,8 @@ BuildRequires: pkgconfig(Qt5Xml) BuildRequires: python3-devel Requires: poppler-data +Requires: libgcc +Requires: glibc Obsoletes: poppler-glib-demos < 0.60.1-1 @@ -154,6 +157,14 @@ Requires: %{name}%{?_isa} = %{version}-%{release} Command line tools for manipulating PDF files and converting them to other formats. +%package doc +Summary: Documents for %{name} +BuildArch: noarch +Requires: %{name} = %{version}-%{release} + +%description doc +Doc pages for %{name}. + %prep %autosetup -p1 -b 1 chmod -x poppler/CairoFontEngine.cc @@ -204,7 +215,6 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %postun cpp -p /sbin/ldconfig %files -%doc README.md %license COPYING %{_libdir}/libpoppler.so.104* @@ -254,7 +264,13 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %{_bindir}/pdf* %{_mandir}/man1/* +%files doc +%doc README.md + %changelog +* Mon Aug 19 2024 Weisson - 20.11.0-12.0.1 +- Add doc sub package + * Fri Jul 26 2024 Marek Kasik - 20.11.0-12 - Fix crash in broken documents when using -dests - Fix versions in changelog -- Gitee