From cc370e9541b1eb624dd0002fba1cd83d636176aa Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Mon, 11 Mar 2019 09:30:55 +0100 Subject: [PATCH] Fix possible crash in ImageStream::getLine() Resolves: #1683633 --- poppler-0.73.0-image-stream-getline.patch | 27 +++++++++++++++++++++++ poppler.spec | 9 +++++++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 poppler-0.73.0-image-stream-getline.patch diff --git a/poppler-0.73.0-image-stream-getline.patch b/poppler-0.73.0-image-stream-getline.patch new file mode 100644 index 0000000..b459a0a --- /dev/null +++ b/poppler-0.73.0-image-stream-getline.patch @@ -0,0 +1,27 @@ +From f4136a6353162db249f63ddb0f20611622ab61b4 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +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/poppler.spec b/poppler.spec index ae97ebd..c9c0cad 100644 --- a/poppler.spec +++ b/poppler.spec @@ -4,7 +4,7 @@ Summary: PDF rendering library Name: poppler Version: 0.73.0 -Release: 5%{?dist} +Release: 6%{?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 @@ -28,6 +28,9 @@ Patch8: poppler-0.73.0-negative-xref-indices.patch # https://bugzilla.redhat.com/show_bug.cgi?id=1665273 Patch9: poppler-0.73.0-check-catalog-is-dict.patch +# https://bugzilla.redhat.com/show_bug.cgi?id=1683632 +Patch10: poppler-0.73.0-image-stream-getline.patch + BuildRequires: cmake BuildRequires: gcc-c++ BuildRequires: gettext-devel @@ -258,6 +261,10 @@ test "$(pkg-config --modversion poppler-splash)" = "%{version}" %{_mandir}/man1/* %changelog +* Mon Mar 11 2019 Marek Kasik - 0.73.0-6 +- Fix possible crash on broken files in ImageStream::getLine() +- Resolves: #1683633 + * Fri Mar 8 2019 Marek Kasik - 0.73.0-5 - Synchronize previous patch with upstream - Related: #1665274