Skip to content

Instantly share code, notes, and snippets.

@apoleon
Created January 3, 2019 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apoleon/7c0f3a0c28437c18fee8a51b1aa16164 to your computer and use it in GitHub Desktop.
Save apoleon/7c0f3a0c28437c18fee8a51b1aa16164 to your computer and use it in GitHub Desktop.
From: Markus Koschany <apo@debian.org>
Date: Thu, 3 Jan 2019 10:41:52 +0100
Subject: CVE-2018-19539
---
src/libjasper/base/jas_image.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/libjasper/base/jas_image.c b/src/libjasper/base/jas_image.c
index 00f37cd..92777c3 100644
--- a/src/libjasper/base/jas_image.c
+++ b/src/libjasper/base/jas_image.c
@@ -491,6 +491,9 @@ int jas_image_readcmpt(jas_image_t *image, int cmptno, jas_image_coord_t x,
image, cmptno, JAS_CAST(long, x), JAS_CAST(long, y),
JAS_CAST(long, width), JAS_CAST(long, height), data));
+ if(data == NULL)
+ return -1;
+
if (cmptno < 0 || cmptno >= image->numcmpts_) {
return -1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment