package/qpdf: bump to version 10.5.0

- Drop patches (already in version and C++14 now required)
- openssl is an optional dependency since version 10.0.0 and
  0f2507234f
- wchar is not mandatory since version 10.0.0 and
  2100b4ce15
- atomic is needed since version 10.0.0 and
  c5c1a028cd
- C++14 is required since version 10.2.0 and
  1b3f84f967

http://qpdf.sourceforge.net/files/qpdf-manual.html#ref.release-notes

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Fabrice Fontaine 2021-12-29 11:41:49 +01:00 committed by Thomas Petazzoni
parent e5d483bfa7
commit b5352c2177
6 changed files with 21 additions and 138 deletions

View File

@ -4,10 +4,10 @@ config BR2_PACKAGE_CUPS_FILTERS
depends on BR2_USE_MMU
depends on BR2_INSTALL_LIBSTDCPP # qpdf
depends on !BR2_STATIC_LIBS
depends on BR2_USE_WCHAR # libglib2, qpdf
depends on BR2_USE_WCHAR # libglib2
depends on BR2_TOOLCHAIN_HAS_THREADS # libglib2
depends on BR2_PACKAGE_CUPS
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_8 # C++11
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # qpdf
select BR2_PACKAGE_JPEG
select BR2_PACKAGE_FONTCONFIG
select BR2_PACKAGE_FREETYPE
@ -31,8 +31,8 @@ config BR2_PACKAGE_CUPS_FILTERS
http://www.linuxfoundation.org/collaborate/workgroups/openprinting/cups-filters
comment "cups-filters needs a toolchain w/ wchar, C++, threads and dynamic library, gcc >= 4.8"
comment "cups-filters needs a toolchain w/ wchar, C++, threads and dynamic library, gcc >= 5"
depends on BR2_USE_MMU
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
!BR2_USE_WCHAR || BR2_STATIC_LIBS || \
!BR2_TOOLCHAIN_GCC_AT_LEAST_4_8
!BR2_TOOLCHAIN_GCC_AT_LEAST_5

View File

@ -1,38 +0,0 @@
From e70c2605a11d12a8eeee3e7eec46077956e11e1f Mon Sep 17 00:00:00 2001
From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Date: Mon, 17 Feb 2020 22:36:08 +0100
Subject: [PATCH] libtests/cxx11.cc: fix build with gcc 4.8
Build fails on gcc 4.8 since version 9.1.1 and commit
752416554086d5d34323bc14164d5084db83cfbd:
libtests/cxx11.cc: In function 'void do_regex()':
libtests/cxx11.cc:347:42: error: 'strlen' is not a member of 'std'
std::cregex_iterator m3(str7, str7 + std::strlen(str7), expr4);
^
To fix the build failure, add missing include on cstring
Fixes:
- http://autobuild.buildroot.org/results/ad7fb68ae87850a85509eed80fd0cae8721b10c5
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
[Upstream status: https://github.com/qpdf/qpdf/pull/400]
---
libtests/cxx11.cc | 1 +
1 file changed, 1 insertion(+)
diff --git a/libtests/cxx11.cc b/libtests/cxx11.cc
index fa1dc6b..91ed7b1 100644
--- a/libtests/cxx11.cc
+++ b/libtests/cxx11.cc
@@ -1,5 +1,6 @@
#include <iostream>
#include <cassert>
+#include <cstring>
#include <functional>
#include <type_traits>
#include <cstdint>
--
2.24.1

View File

@ -1,86 +0,0 @@
From dc92574c10f3e2516ec6445b88c5d584f40df4e5 Mon Sep 17 00:00:00 2001
From: Jay Berkenbilt <ejb@ql.org>
Date: Mon, 4 Jan 2021 11:55:28 -0500
Subject: [PATCH] Fix some pipelines to be safe if downstream write fails (fuzz
issue 28262)
[Retrieved (and updated to remove updates on ChangeLog and fuzz) from:
https://github.com/qpdf/qpdf/commit/dc92574c10f3e2516ec6445b88c5d584f40df4e5]
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
ChangeLog | 6 ++++++
fuzz/qpdf_extra/28262.fuzz | Bin 0 -> 40395 bytes
libqpdf/Pl_AES_PDF.cc | 2 +-
libqpdf/Pl_ASCII85Decoder.cc | 7 +++++--
libqpdf/Pl_ASCIIHexDecoder.cc | 6 ++++--
libqpdf/Pl_Count.cc | 2 +-
6 files changed, 17 insertions(+), 6 deletions(-)
create mode 100644 fuzz/qpdf_extra/28262.fuzz
diff --git a/libqpdf/Pl_AES_PDF.cc b/libqpdf/Pl_AES_PDF.cc
index 18cf3a4d..2865f804 100644
--- a/libqpdf/Pl_AES_PDF.cc
+++ b/libqpdf/Pl_AES_PDF.cc
@@ -238,6 +238,6 @@ Pl_AES_PDF::flush(bool strip_padding)
}
}
}
- getNext()->write(this->outbuf, bytes);
this->offset = 0;
+ getNext()->write(this->outbuf, bytes);
}
diff --git a/libqpdf/Pl_ASCII85Decoder.cc b/libqpdf/Pl_ASCII85Decoder.cc
index b8df3e87..9d9f6704 100644
--- a/libqpdf/Pl_ASCII85Decoder.cc
+++ b/libqpdf/Pl_ASCII85Decoder.cc
@@ -119,10 +119,13 @@ Pl_ASCII85Decoder::flush()
QTC::TC("libtests", "Pl_ASCII85Decoder partial flush",
(this->pos == 5) ? 0 : 1);
- getNext()->write(outbuf, this->pos - 1);
-
+ // Reset before calling getNext()->write in case that throws an
+ // exception.
+ auto t = this->pos - 1;
this->pos = 0;
memset(this->inbuf, 117, 5);
+
+ getNext()->write(outbuf, t);
}
void
diff --git a/libqpdf/Pl_ASCIIHexDecoder.cc b/libqpdf/Pl_ASCIIHexDecoder.cc
index f20a9769..7845268e 100644
--- a/libqpdf/Pl_ASCIIHexDecoder.cc
+++ b/libqpdf/Pl_ASCIIHexDecoder.cc
@@ -97,12 +97,14 @@ Pl_ASCIIHexDecoder::flush()
QTC::TC("libtests", "Pl_ASCIIHexDecoder partial flush",
(this->pos == 2) ? 0 : 1);
- getNext()->write(&ch, 1);
-
+ // Reset before calling getNext()->write in case that throws an
+ // exception.
this->pos = 0;
this->inbuf[0] = '0';
this->inbuf[1] = '0';
this->inbuf[2] = '\0';
+
+ getNext()->write(&ch, 1);
}
void
diff --git a/libqpdf/Pl_Count.cc b/libqpdf/Pl_Count.cc
index 8077092a..c35619b8 100644
--- a/libqpdf/Pl_Count.cc
+++ b/libqpdf/Pl_Count.cc
@@ -27,8 +27,8 @@ Pl_Count::write(unsigned char* buf, size_t len)
if (len)
{
this->m->count += QIntC::to_offset(len);
- getNext()->write(buf, len);
this->m->last_char = buf[len - 1];
+ getNext()->write(buf, len);
}
}

View File

@ -1,8 +1,7 @@
config BR2_PACKAGE_QPDF
bool "qpdf"
depends on BR2_INSTALL_LIBSTDCPP
depends on BR2_USE_WCHAR
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 # C++11
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_5 # C++14
select BR2_PACKAGE_ZLIB
select BR2_PACKAGE_JPEG
help
@ -15,6 +14,6 @@ config BR2_PACKAGE_QPDF
http://qpdf.sourceforge.net/
comment "qpdf needs a toolchain w/ C++, wchar, gcc >= 4.7"
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_USE_WCHAR || \
!BR2_TOOLCHAIN_GCC_AT_LEAST_4_7
comment "qpdf needs a toolchain w/ C++, gcc >= 5"
depends on !BR2_INSTALL_LIBSTDCPP || \
!BR2_TOOLCHAIN_GCC_AT_LEAST_5

View File

@ -1,5 +1,5 @@
# From https://sourceforge.net/projects/qpdf/files/qpdf/9.1.1/qpdf-9.1.1.sha512/download
sha512 008a11fef663a57ca173631f2053988023babea6c333cfe01db0ef955c8cd36d387ed9f2039f55bd5f9ca94c7a8e400461a09a15c5f89e03bc0817fdd0d3d585 qpdf-9.1.1.tar.gz
# From https://sourceforge.net/projects/qpdf/files/qpdf/10.5.0/qpdf-10.5.0.sha256/download
sha256 88257d36a44fd5c50b2879488324dd9cafc11686ae49d8c4922a4872203ce006 qpdf-10.5.0.tar.gz
# Locally computed:
sha256 cfc7749b96f63bd31c3c42b5c471bf756814053e847c10f3eb003417bc523d30 LICENSE.txt
sha256 fb929ac30decb4dc3a2eea2bec6c43296a797c5d2d602deb3784ee39430583d5 Artistic-2.0

View File

@ -4,7 +4,7 @@
#
################################################################################
QPDF_VERSION = 9.1.1
QPDF_VERSION = 10.5.0
QPDF_SITE = http://downloads.sourceforge.net/project/qpdf/qpdf/$(QPDF_VERSION)
QPDF_INSTALL_STAGING = YES
QPDF_LICENSE = Apache-2.0 or Artistic-2.0
@ -14,8 +14,9 @@ QPDF_DEPENDENCIES = host-pkgconf zlib jpeg
QPDF_CONF_OPTS = --with-random=/dev/urandom
# 0002-Fix-some-pipelines-to-be-safe-if-downstream-write-fails.patch
QPDF_IGNORE_CVES += CVE-2021-36978
ifeq ($(BR2_USE_WCHAR),)
QPDF_CONF_ENV += CXXFLAGS="$(TARGET_CXXFLAGS) -DQPDF_NO_WCHAR_T"
endif
ifeq ($(BR2_PACKAGE_GNUTLS),y)
QPDF_CONF_OPTS += --enable-crypto-gnutls
@ -24,4 +25,11 @@ else
QPDF_CONF_OPTS += --disable-crypto-gnutls
endif
ifeq ($(BR2_PACKAGE_OPENSSL),y)
QPDF_CONF_OPTS += --enable-crypto-openssl
QPDF_DEPENDENCIES += openssl
else
QPDF_CONF_OPTS += --disable-crypto-openssl
endif
$(eval $(autotools-package))