Skip to content
Snippets Groups Projects
Commit 98c81b6b authored by Krassy Boykinov's avatar Krassy Boykinov Committed by Natanael Copa
Browse files

main/poppler: upgrade to 25.01.0

parent f291529b
No related branches found
No related tags found
2 merge requests!79570community/firefox-esr: upgrade to 128.7.0,!71840poppler{,-qt5}: security upgrade to 25.01.0
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=poppler
pkgver=24.02.0
pkgrel=2
pkgver=25.01.0
pkgrel=0
pkgdesc="PDF rendering library based on xpdf 3.0"
url="https://poppler.freedesktop.org/"
arch="all"
......@@ -25,9 +25,7 @@ makedepends="
zlib-dev
"
subpackages="$pkgname-dev $pkgname-doc $pkgname-glib $pkgname-utils"
source="https://poppler.freedesktop.org/poppler-$pkgver.tar.xz
CVE-2024-6239.patch
"
source="https://poppler.freedesktop.org/poppler-$pkgver.tar.xz"
options="!check" # Requires dl of testfiles and only checks qt5 libs
# secfixes:
......@@ -106,6 +104,5 @@ _cpp() {
}
sha512sums="
95a208d21ac4d2d308a7ab3da43b95092ef78cd55ebe873c97e0d6c12d8b9d5c4614f83087616c35e1ed9d67ca606a5e008a98698bd12a332a8206ed4cf55500 poppler-24.02.0.tar.xz
0614c3b40259a8776e010897d8d448b5ff106abe6d5c04591573f406deafb9b62d3a9189577ff657cbdfda1afe59009826ebf021bddc8dd07d9bd8e55ccd2937 CVE-2024-6239.patch
9791e32099a13a8e80c87f7be874da0fee21f84246c0d9e37ad0e902189e9bf027a35757e26a1b2bf161a098d0bed29abc1550301767d686928ed77c37977b93 poppler-25.01.0.tar.xz
"
Patch-Source: https://gitlab.freedesktop.org/poppler/poppler/-/merge_requests/1563
---
From 0554731052d1a97745cb179ab0d45620589dd9c4 Mon Sep 17 00:00:00 2001
From: Albert Astals Cid <aacid@kde.org>
Date: Fri, 7 Jun 2024 00:54:55 +0200
Subject: [PATCH] pdfinfo: Fix crash in broken documents when using -dests
---
utils/pdfinfo.cc | 35 +++++++++++++++--------------------
1 file changed, 15 insertions(+), 20 deletions(-)
diff --git a/utils/pdfinfo.cc b/utils/pdfinfo.cc
index 5d37ef64f..7d569749b 100644
--- a/utils/pdfinfo.cc
+++ b/utils/pdfinfo.cc
@@ -15,7 +15,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2006 Dom Lachowicz <cinamod@hotmail.com>
-// Copyright (C) 2007-2010, 2012, 2016-2022 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2007-2010, 2012, 2016-2022, 2024 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2010 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2011 Vittal Aithal <vittal.aithal@cognidox.com>
// Copyright (C) 2012, 2013, 2016-2018, 2021 Adrian Johnson <ajohnson@redneon.com>
@@ -113,16 +113,21 @@ static const ArgDesc argDesc[] = { { "-f", argInt, &firstPage, 0, "first page to
{ "-?", argFlag, &printHelp, 0, "print usage information" },
{} };
-static void printTextString(const GooString *s, const UnicodeMap *uMap)
+static void printStdTextString(const std::string &s, const UnicodeMap *uMap)
{
char buf[8];
- std::vector<Unicode> u = TextStringToUCS4(s->toStr());
+ const std::vector<Unicode> u = TextStringToUCS4(s);
for (const auto &c : u) {
int n = uMap->mapUnicode(c, buf, sizeof(buf));
fwrite(buf, 1, n, stdout);
}
}
+static void printTextString(const GooString *s, const UnicodeMap *uMap)
+{
+ printStdTextString(s->toStr(), uMap);
+}
+
static void printUCS4String(const Unicode *u, int len, const UnicodeMap *uMap)
{
char buf[8];
@@ -294,11 +299,6 @@ static void printStruct(const StructElement *element, unsigned indent)
}
}
-struct GooStringCompare
-{
- bool operator()(GooString *lhs, GooString *rhs) const { return lhs->cmp(const_cast<GooString *>(rhs)) < 0; }
-};
-
static void printLinkDest(const std::unique_ptr<LinkDest> &dest)
{
GooString s;
@@ -369,29 +369,25 @@ static void printLinkDest(const std::unique_ptr<LinkDest> &dest)
static void printDestinations(PDFDoc *doc, const UnicodeMap *uMap)
{
- std::map<Ref, std::map<GooString *, std::unique_ptr<LinkDest>, GooStringCompare>> map;
+ std::map<Ref, std::map<std::string, std::unique_ptr<LinkDest>>> 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<LinkDest> 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<LinkDest> 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;
}
}
@@ -405,9 +401,8 @@ static void printDestinations(PDFDoc *doc, const UnicodeMap *uMap)
printf("%4d ", i);
printLinkDest(it.second);
printf(" \"");
- printTextString(it.first, uMap);
+ printStdTextString(it.first, uMap);
printf("\"\n");
- delete it.first;
}
}
}
--
GitLab
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment