summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-11-20 13:11:59 +0100
committerAndras Timar <andras.timar@collabora.com>2021-05-10 16:33:57 +0200
commit124334c1e6b3f8021df55a6df406c48389cbab3f (patch)
treec2a9bb23d9f66ea3aca42668b54763c6a9bca119
parent017adc35f3232746f9d71b58ed9117823d206485 (diff)
poppler: upgrade to release 0.82.0
fixes CVE-2019-9903 CVE-2019-9631 CVE-2019-9545 CVE-2019-9543 CVE-2019-14494 CVE-2019-12293 CVE-2019-11026 CVE-2019-10873 CVE-2019-10872 CVE-2019-10871 CVE-2019-10018 remove obsolete 0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1 Reviewed-on: https://gerrit.libreoffice.org/83308 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@cib.de> (cherry picked from commit 28e52c49452320ac76489d0f93ca5692456e5331) Reviewed-on: https://gerrit.libreoffice.org/83336 Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit f3b2d61376c6d7ae262f58406d89ef0caa8b0aaf) Change-Id: I72b3bf89b294ed3e24157c7e75fd58d4f68d9f35
-rw-r--r--download.lst4
-rw-r--r--external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.127
-rw-r--r--external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1169
-rw-r--r--external/poppler/StaticLibrary_poppler.mk1
-rw-r--r--external/poppler/UnpackedTarball_poppler.mk4
-rw-r--r--external/poppler/poppler-config.patch.119
6 files changed, 185 insertions, 39 deletions
diff --git a/download.lst b/download.lst
index ca44e2d2c3a7..f6e94fbcc512 100644
--- a/download.lst
+++ b/download.lst
@@ -191,8 +191,8 @@ export PIXMAN_SHA256SUM := 21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3
export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
export PNG_SHA256SUM := 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca
export PNG_TARBALL := libpng-1.6.37.tar.xz
-export POPPLER_SHA256SUM := 92e09fd3302567fd36146b36bb707db43ce436e8841219025a82ea9fb0076b2f
-export POPPLER_TARBALL := poppler-0.74.0.tar.xz
+export POPPLER_SHA256SUM := 234f8e573ea57fb6a008e7c1e56bfae1af5d1adf0e65f47555e1ae103874e4df
+export POPPLER_TARBALL := poppler-0.82.0.tar.xz
export POSTGRESQL_SHA256SUM := db61d498105a7d5fe46185e67ac830c878cdd7dc1f82a87f06b842217924c461
export POSTGRESQL_TARBALL := c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
export PYTHON_SHA256SUM := c24a37c63a67f53bdd09c5f287b5cff8e8b98f857bf348c577d454d3f74db049
diff --git a/external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1 b/external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1
deleted file mode 100644
index b459a0a0bef7..000000000000
--- a/external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1
+++ /dev/null
@@ -1,27 +0,0 @@
-From f4136a6353162db249f63ddb0f20611622ab61b4 Mon Sep 17 00:00:00 2001
-From: Albert Astals Cid <aacid@kde.org>
-Date: Wed, 27 Feb 2019 19:43:22 +0100
-Subject: [PATCH] ImageStream::getLine: fix crash on broken files
-
-Fixes #728
----
- poppler/Stream.cc | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/poppler/Stream.cc b/poppler/Stream.cc
-index 33537b0e..a41435ab 100644
---- a/poppler/Stream.cc
-+++ b/poppler/Stream.cc
-@@ -496,6 +496,9 @@ unsigned char *ImageStream::getLine() {
- }
-
- int readChars = str->doGetChars(inputLineSize, inputLine);
-+ if (unlikely(readChars == -1)) {
-+ readChars = 0;
-+ }
- for ( ; readChars < inputLineSize; readChars++) inputLine[readChars] = EOF;
- if (nBits == 1) {
- unsigned char *p = inputLine;
---
-2.20.1
-
diff --git a/external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1 b/external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1
new file mode 100644
index 000000000000..26fdc10dec50
--- /dev/null
+++ b/external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1
@@ -0,0 +1,169 @@
+Revert "Make the mul tables be calculated at compile time with constexpr"
+
+This reverts commit e0ef346c0f669140076c4cf443f07ea0770996da.
+---
+ poppler/Decrypt.cc | 134 ++++++++++++---------------------------------
+ 1 file changed, 35 insertions(+), 99 deletions(-)
+
+diff --git a/poppler/Decrypt.cc b/poppler/Decrypt.cc
+index 57945778..f5062929 100644
+--- a/poppler/Decrypt.cc
++++ b/poppler/Decrypt.cc
+@@ -763,119 +763,55 @@ static inline void invShiftRows(unsigned char *state) {
+ }
+
+ // {02} \cdot s
+-struct Mul02Table
+-{
+- constexpr Mul02Table() : values()
+- {
+- for(int s = 0; s < 256; s++) {
+- values[s] = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+- }
+- }
+-
+- constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
+-
+- unsigned char values[256];
+-};
+-
+-static constexpr Mul02Table mul02;
++static inline unsigned char mul02(unsigned char s) {
++ return (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++}
+
+ // {03} \cdot s
+-struct Mul03Table
+-{
+- constexpr Mul03Table() : values()
+- {
+- for(int s=0; s<256; s++) {
+- const unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+- values[s] = s ^ s2;
+- }
+- }
+-
+- constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
+-
+- unsigned char values[256];
+-};
+-
+-static constexpr Mul03Table mul03;
++static inline unsigned char mul03(unsigned char s) {
++ unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++ return s ^ s2;
++}
+
+ // {09} \cdot s
+-struct Mul09Table
+-{
+- constexpr Mul09Table() : values()
+- {
+- for(int s=0; s<256; s++) {
+- const unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+- const unsigned char s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+- const unsigned char s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+- values[s] = s ^ s8;
+- }
+- }
+-
+- constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
+-
+- unsigned char values[256];
+-};
++static inline unsigned char mul09(unsigned char s) {
++ unsigned char s2, s4, s8;
+
+-static constexpr Mul09Table mul09;
++ s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++ s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
++ s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
++ return s ^ s8;
++}
+
+ // {0b} \cdot s
+-struct Mul0bTable
+-{
+- constexpr Mul0bTable() : values()
+- {
+- for(int s=0; s<256; s++) {
+- const unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+- const unsigned char s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+- const unsigned char s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+- values[s] = s ^ s2 ^ s8;
+- }
+- }
+-
+- constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
++static inline unsigned char mul0b(unsigned char s) {
++ unsigned char s2, s4, s8;
+
+- unsigned char values[256];
+-};
+-
+-static constexpr Mul0bTable mul0b;
++ s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++ s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
++ s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
++ return s ^ s2 ^ s8;
++}
+
+ // {0d} \cdot s
+-struct Mul0dTable
+-{
+- constexpr Mul0dTable() : values()
+- {
+- for(int s=0; s<256; s++) {
+- const unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+- const unsigned char s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+- const unsigned char s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+- values[s] = s ^ s4 ^ s8;
+- }
+- }
++static inline unsigned char mul0d(unsigned char s) {
++ unsigned char s2, s4, s8;
+
+- constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
+-
+- unsigned char values[256];
+-};
+-
+-static constexpr Mul0dTable mul0d;
++ s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++ s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
++ s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
++ return s ^ s4 ^ s8;
++}
+
+ // {0e} \cdot s
+-struct Mul0eTable
+-{
+- constexpr Mul0eTable() : values()
+- {
+- for(int s=0; s<256; s++) {
+- const unsigned char s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
+- const unsigned char s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
+- const unsigned char s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
+- values[s] = s2 ^ s4 ^ s8;
+- }
+- }
+-
+- constexpr unsigned char operator()(uint8_t i) const { return values[i]; }
++static inline unsigned char mul0e(unsigned char s) {
++ unsigned char s2, s4, s8;
+
+- unsigned char values[256];
+-};
+-
+-static constexpr Mul0eTable mul0e;
++ s2 = (s & 0x80) ? ((s << 1) ^ 0x1b) : (s << 1);
++ s4 = (s2 & 0x80) ? ((s2 << 1) ^ 0x1b) : (s2 << 1);
++ s8 = (s4 & 0x80) ? ((s4 << 1) ^ 0x1b) : (s4 << 1);
++ return s2 ^ s4 ^ s8;
++}
+
+ static inline void mixColumns(unsigned char *state) {
+ int c;
+--
+2.21.0
+
diff --git a/external/poppler/StaticLibrary_poppler.mk b/external/poppler/StaticLibrary_poppler.mk
index 17e921cb82d8..59a5a4ac94f0 100644
--- a/external/poppler/StaticLibrary_poppler.mk
+++ b/external/poppler/StaticLibrary_poppler.mk
@@ -55,7 +55,6 @@ $(eval $(call gb_StaticLibrary_add_generated_exception_objects,poppler,\
UnpackedTarball/poppler/goo/gfile \
UnpackedTarball/poppler/goo/GooTimer \
UnpackedTarball/poppler/goo/GooString \
- UnpackedTarball/poppler/goo/FixedPoint \
UnpackedTarball/poppler/goo/NetPBMWriter \
UnpackedTarball/poppler/goo/PNGWriter \
UnpackedTarball/poppler/goo/TiffWriter \
diff --git a/external/poppler/UnpackedTarball_poppler.mk b/external/poppler/UnpackedTarball_poppler.mk
index 151fa5d0444f..76fd33236e5d 100644
--- a/external/poppler/UnpackedTarball_poppler.mk
+++ b/external/poppler/UnpackedTarball_poppler.mk
@@ -14,7 +14,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,poppler,$(POPPLER_TARBALL),,poppler
$(eval $(call gb_UnpackedTarball_add_patches,poppler,\
external/poppler/poppler-config.patch.1 \
external/poppler/poppler-c++11.patch.1 \
- external/poppler/0001-ImageStream-getLine-fix-crash-on-broken-files.patch.1 \
+ external/poppler/0001-Revert-Make-the-mul-tables-be-calculated-at-compile-.patch.1 \
))
# std::make_unique is only available in C++14
@@ -23,7 +23,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\
# be happy with std::make_unique so just skip it
ifneq ($(OS_FOR_BUILD),MACOSX)
$(eval $(call gb_UnpackedTarball_set_post_action,poppler,\
- env -i PATH="$(PATH)" $(FIND) . -name '*.cc' -exec sed -i -e 's/std::make_unique/o3tl::make_unique/' {} \\; \
+ env -i PATH="$(if $(filter WNT,$(OS)),/usr/bin,$(PATH))" $(FIND) . -name '*.cc' -exec sed -i -e 's/std::make_unique/o3tl::make_unique/' {} \\; \
))
endif
diff --git a/external/poppler/poppler-config.patch.1 b/external/poppler/poppler-config.patch.1
index 1c68806276f7..cb74cd66fb5e 100644
--- a/external/poppler/poppler-config.patch.1
+++ b/external/poppler/poppler-config.patch.1
@@ -195,7 +195,7 @@ index 0fbd336a..451213f8 100644
+#define PACKAGE_NAME "poppler"
+
+/* Define to the full name and version of this package. */
-+#define PACKAGE_STRING "poppler 0.74.0"
++#define PACKAGE_STRING "poppler 0.82.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "poppler"
@@ -204,7 +204,7 @@ index 0fbd336a..451213f8 100644
+#define PACKAGE_URL ""
+
+/* Define to the version of this package. */
-+#define PACKAGE_VERSION "0.74.0"
++#define PACKAGE_VERSION "0.82.0"
+
+/* Poppler data dir */
+#define POPPLER_DATADIR "/usr/local/share/poppler"
@@ -228,7 +228,7 @@ index 0fbd336a..451213f8 100644
+/* #undef USE_FLOAT */
+
+/* Version number of package */
-+#define VERSION "0.74.0"
++#define VERSION "0.82.0"
+
+#if defined(__APPLE__)
+#elif defined (_WIN32)
@@ -268,7 +268,7 @@ new file mode 100644
index 0fbd336a..451213f8 100644
--- /dev/null
+++ b/poppler/poppler-config.h
-@@ -0,0 +1,168 @@
+@@ -0,0 +1,173 @@
+//================================================= -*- mode: c++ -*- ====
+//
+// poppler-config.h
@@ -304,7 +304,7 @@ index 0fbd336a..451213f8 100644
+
+/* Defines the poppler version. */
+#ifndef POPPLER_VERSION
-+#define POPPLER_VERSION "0.74.0"
++#define POPPLER_VERSION "0.82.0"
+#endif
+
+/* Enable multithreading support. */
@@ -396,6 +396,11 @@ index 0fbd336a..451213f8 100644
+/* #undef USE_CMS */
+#endif
+
++/* Use header-only classes from Boost in the Splash backend */
++#ifndef USE_BOOST_HEADERS
++/* #undef USE_BOOST_HEADERS */
++#endif
++
+// Also, there are preprocessor symbols in the header files
+// that are used but never defined when building poppler using configure
+// or cmake: DISABLE_OUTLINE, DEBUG_MEM,
@@ -466,9 +471,9 @@ index 0fbd336a..451213f8 100644
+
+#include "poppler-global.h"
+
-+#define POPPLER_VERSION "0.74.0"
++#define POPPLER_VERSION "0.82.0"
+#define POPPLER_VERSION_MAJOR 0
-+#define POPPLER_VERSION_MINOR 74
++#define POPPLER_VERSION_MINOR 82
+#define POPPLER_VERSION_MICRO 0
+
+namespace poppler