diff --git a/backport-CVE-2022-27337.patch b/backport-CVE-2022-27337.patch new file mode 100644 index 0000000000000000000000000000000000000000..e879c7cbe9ba3c1973e0a59546399844463596a9 --- /dev/null +++ b/backport-CVE-2022-27337.patch @@ -0,0 +1,68 @@ +From 81044c64b9ed9a10ae82a28bac753060bdfdac74 Mon Sep 17 00:00:00 2001 +From: Albert Astals Cid +Date: Tue, 15 Mar 2022 15:14:32 +0100 +Subject: [PATCH] Hints::readTables: bail out if we run out of file when + reading + +Fixes #1230 + +Reference:https://gitlab.freedesktop.org/poppler/poppler/-/commit/81044c64b9ed9a10ae82a28bac753060bdfdac74 +Conflict:NA + +--- + poppler/Hints.cc | 24 +++++++++++++++++------- + 1 file changed, 17 insertions(+), 7 deletions(-) + +diff --git a/poppler/Hints.cc b/poppler/Hints.cc +index 79f040888..4707e1c69 100644 +--- a/poppler/Hints.cc ++++ b/poppler/Hints.cc +@@ -5,7 +5,7 @@ + // This file is licensed under the GPLv2 or later + // + // Copyright 2010, 2012, 2013 Hib Eris +-// Copyright 2010, 2011, 2013, 2014, 2016-2019, 2021 Albert Astals Cid ++// Copyright 2010, 2011, 2013, 2014, 2016-2019, 2021, 2022 Albert Astals Cid + // Copyright 2010, 2013 Pino Toscano + // Copyright 2013 Adrian Johnson + // Copyright 2014 Fabio D'Urso +@@ -189,21 +189,31 @@ void Hints::readTables(BaseStream *str, Linearization *linearization, XRef *xref + char *p = &buf[0]; + + if (hintsOffset && hintsLength) { +- Stream *s = str->makeSubStream(hintsOffset, false, hintsLength, Object(objNull)); ++ std::unique_ptr s(str->makeSubStream(hintsOffset, false, hintsLength, Object(objNull))); + s->reset(); + for (unsigned int i = 0; i < hintsLength; i++) { +- *p++ = s->getChar(); ++ const int c = s->getChar(); ++ if (unlikely(c == EOF)) { ++ error(errSyntaxWarning, -1, "Found EOF while reading hints"); ++ ok = false; ++ return; ++ } ++ *p++ = c; + } +- delete s; + } + + if (hintsOffset2 && hintsLength2) { +- Stream *s = str->makeSubStream(hintsOffset2, false, hintsLength2, Object(objNull)); ++ std::unique_ptr s(str->makeSubStream(hintsOffset2, false, hintsLength2, Object(objNull))); + s->reset(); + for (unsigned int i = 0; i < hintsLength2; i++) { +- *p++ = s->getChar(); ++ const int c = s->getChar(); ++ if (unlikely(c == EOF)) { ++ error(errSyntaxWarning, -1, "Found EOF while reading hints2"); ++ ok = false; ++ return; ++ } ++ *p++ = c; + } +- delete s; + } + + MemStream *memStream = new MemStream(&buf[0], 0, bufLength, Object(objNull)); +-- +GitLab diff --git a/poppler.spec b/poppler.spec index 0a640e8ed12f504fdc6948f12746ff3adc28bae0..1965ecdb933b31f56559d05a4a1bdb6f19ad6286 100644 --- a/poppler.spec +++ b/poppler.spec @@ -4,7 +4,7 @@ Name: poppler Version: 22.01.0 -Release: 2 +Release: 3 Summary: PDF rendering library License: GPLv2+ and LGPLv2+ and MIT URL: http://poppler.freedesktop.org/ @@ -15,6 +15,8 @@ Patch1: poppler-0.90.0-position-independent-code.patch Patch3: poppler-21.01.0-glib-introspection.patch Patch4: CVE-2022-38784.patch +patch6000: backport-CVE-2022-27337.patch + BuildRequires: make BuildRequires: cmake BuildRequires: gcc-c++ @@ -249,6 +251,12 @@ test "$(pkg-config --modversion poppler-qt6)" = "%{version}" %{_mandir}/man1/* %changelog +* Tue Mar 14 2023 zhangpan - 22.01.0-3 +- Type:CVE +- CVE:CVE-2022-27337 +- SUG:NA +- DESC:fix CVE-2022-27337 + * Tue Sep 06 2022 qz_cx - 22.01.0-2 - Type:CVE - CVE:CVE-2022-38784