Bug 1388866 (CVE-2016-8882) - CVE-2016-8882 jasper: uninitialized tile->pi pointer use in JPC decoder
Summary: CVE-2016-8882 jasper: uninitialized tile->pi pointer use in JPC decoder
Alias: CVE-2016-8882
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
Target Milestone: ---
Assignee: Red Hat Product Security
QA Contact:
Depends On: 1388873 1388874 1388875 1388876
Blocks: Embargoed1314477
TreeView+ depends on / blocked
Reported: 2016-10-26 10:38 UTC by Adam Mariš
Modified: 2019-09-29 13:58 UTC (History)
28 users (show)

Fixed In Version: jasper 1.900.8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2017-03-01 15:32:45 UTC

Attachments (Terms of Use)

Description Adam Mariš 2016-10-26 10:38:44 UTC
Null pointer access due to improper initialization was found in jpc_pi_destroy.

Upstream patch:


CVE assignment:


Comment 1 Adam Mariš 2016-10-26 10:50:50 UTC
Created mingw-jasper tracking bugs for this issue:

Affects: fedora-all [bug 1388874]
Affects: epel-7 [bug 1388876]

Comment 2 Adam Mariš 2016-10-26 10:51:07 UTC
Created jasper tracking bugs for this issue:

Affects: fedora-all [bug 1388873]
Affects: epel-5 [bug 1388875]

Comment 3 Tomas Hoger 2017-03-01 15:32:45 UTC
Upstream bug report:


The problem was in the jpc_dec_process_siz() function, which did not initialize tile->pi.  Later on, when tile data was freed, non-NULL tile->pi led to the call of jpc_pi_destroy() function, which dereferenced and possibly tried to free uninitialized / invalid pointer.  That could cause crash, or could possibly lead to use-after-free or double free.

This issue did not affect jasper packages in Red Hat Enterprise Linux 6 and 7 because of the inclusion of the CVE-2008-3520 fix in those packages.  The patch makes jpc_dec_process_siz() function use calloc instead of malloc when allocating dec->tiles memory, using this change:

-    if (!(dec->tiles = jas_malloc(dec->numtiles * sizeof(jpc_dec_tile_t)))) {
+    if (!(dec->tiles = jas_calloc(dec->numtiles, sizeof(jpc_dec_tile_t)))) {

This was meant to protect against integer overflow when computing the amount of required memory allocation, but also has a side effect of initializing tile structure with zeros.  I.e. tile->pi is initialized to 0 / NULL, which is equivalent to the upstream fix for this issue.

This fix was also included in netpbm packages updates in Red Hat Enterprise Linux 4 and 5 via RHSA-2009:0012:


Note You need to log in before you can comment on or make changes to this bug.