Skip to content

Commit

Permalink
poppler_0_61: add patch for CVE-2019-9959
Browse files Browse the repository at this point in the history
custom adapted patch to accommodate the openjpeg1/openjpeg2 split that
0.61 still has
  • Loading branch information
risicle committed Oct 12, 2019
1 parent ce2bbeb commit e6889d4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
20 changes: 20 additions & 0 deletions pkgs/development/libraries/poppler/0.61-CVE-2019-9959.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc
--- a/poppler/JPEG2000Stream.cc
+++ b/poppler/JPEG2000Stream.cc
@@ -201,7 +201,7 @@ void JPXStream::init()
if (getDict()) smaskInData = getDict()->lookup("SMaskInData");

int bufSize = BUFFER_INITIAL_SIZE;
- if (oLen.isInt()) bufSize = oLen.getInt();
+ if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getInt();

if (cspace.isArray() && cspace.arrayGetLength() > 0) {

@@ -365,7 +365,7 @@ void JPXStream::init()
}

int bufSize = BUFFER_INITIAL_SIZE;
- if (oLen.isInt()) bufSize = oLen.getInt();
+ if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getInt();

if (cspace.isArray() && cspace.arrayGetLength() > 0) {
1 change: 1 addition & 0 deletions pkgs/development/libraries/poppler/0.61.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ stdenv.mkDerivation rec {
url = "https://cgit.freedesktop.org/poppler/poppler/patch/?id=004e3c10df0abda214f0c293f9e269fdd979c5ee";
sha256 = "1l8713s57xc6g81bldw934rsfm140fqc7ggd50ha5mxdl1b3app2";
})
./0.61-CVE-2019-9959.patch
];

buildInputs = [ libiconv libintl ] ++ lib.optional withData poppler_data;
Expand Down

0 comments on commit e6889d4

Please sign in to comment.