summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2019-11-20 13:11:59 +0100
committerMichael Stahl <michael.stahl@cib.de>2019-11-25 16:59:57 +0100
commitc7240a2eb2a7563353646b10a04a26a29663b8fe (patch)
tree3f736f655b9fd08873370859348b9b128100f9e9
parentc5d14bbb7c849416278c11a8e5d7640cd6399f63 (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 Reviewed-on: https://gerrit.libreoffice.org/83529 Reviewed-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Michael Stahl <michael.stahl@cib.de>
-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 012084f7c06b..9d6744d9cc8d 100644
--- a/download.lst
+++ b/download.lst
@@ -133,8 +133,8 @@ export PAGEMAKER_TARBALL := libpagemaker-0.0.3.tar.bz2
export PIXMAN_TARBALL := c63f411b3ad147db2bcce1bf262a0e02-pixman-0.24.4.tar.bz2
export PNG_MD5SUM := 015e8e15db1eecde5f2eb9eb5b6e59e9
export PNG_TARBALL := libpng-1.6.37.tar.xz
-export POPPLER_MD5SUM := 1ce581bde2f23fa55bee13d8c61ac0df
-export POPPLER_TARBALL := poppler-0.74.0.tar.xz
+export POPPLER_MD5SUM := 4d6106c2382c5e66072e0b355acc3640
+export POPPLER_TARBALL := poppler-0.82.0.tar.xz
export POSTGRESQL_TARBALL := c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
export PYTHON_MD5SUM := ef7f82485e83c7f8f8bcb920a9c2457b
export PYTHON_TARBALL := Python-3.5.9.tar.xz
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 8a38987cab09..13d2c953aeff 100644
--- a/external/poppler/UnpackedTarball_poppler.mk
+++ b/external/poppler/UnpackedTarball_poppler.mk
@@ -15,7 +15,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,poppler,\
$(if $(filter MSC-120,$(COM)-$(VCVER)),external/poppler/poppler-snprintf.patch.1) \
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
@@ -24,7 +24,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