Skip to content

Commit

Permalink
Check data in jas_image
Browse files Browse the repository at this point in the history
Regarding CVE-2018-19539.
Fix by Markus Koschany <apo@debian.org>.
From https://gist.github.com/apoleon/7c0f3a0c28437c18fee8a51b1aa16164.
  • Loading branch information
jubalh committed Mar 12, 2019
1 parent 573a6e4 commit 243749e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libjasper/base/jas_image.c
Expand Up @@ -491,6 +491,10 @@ 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;
}
Expand Down

0 comments on commit 243749e

Please sign in to comment.