Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NULL Pointer Access in function imagetopnm of convert.c:1943(jp2) #857

Open
Young-X opened this issue Oct 29, 2016 · 5 comments
Open

NULL Pointer Access in function imagetopnm of convert.c:1943(jp2) #857

Young-X opened this issue Oct 29, 2016 · 5 comments

Comments

@Young-X
Copy link

Young-X commented Oct 29, 2016

DESCRIPTION
OPENJPEG null ptr dereference in convertbmp.c:980

VERSION
OPENJPEG-2.1.2

Address Sanitizer Output
==3411==ERROR: AddressSanitizer: SEGV on unknown address 0x00000000 (pc 0x08146eaf bp 0xbfc960a8 sp 0xbfc96040 T0)
#0 0x8146eae (/home/yang/openjpeg/openjpeg-2.1.2/build-clang/bin/opj_decompress+0x8146eae)
#1 0x813715c (/home/yang/openjpeg/openjpeg-2.1.2/build-clang/bin/opj_decompress+0x813715c)
#2 0xb7403636 (/lib/i386-linux-gnu/libc.so.6+0x18636)
#3 0x805f327 (/home/yang/openjpeg/openjpeg-2.1.2/build-clang/bin/opj_decompress+0x805f327)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/home/yang/openjpeg/openjpeg-2.1.2/build-clang/bin/opj_decompress+0x8146eae)

GDB Information
Breakpoint 4, imagetopnm (image=0x8d2d5c0, outfile=0xbfb08654 "image.pnm", force_split=0)
at /home/yang/openjpeg/openjpeg-2.1.2/src/bin/jp2/convert.c:1935
1935 red = image->comps[compno].data;
(rr) p red
$7 = (int *) 0xbfb05558
(rr) p image->comps[compno].data
$8 = (OPJ_INT32 *) 0x0
(rr) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x08051b76 in imagetopnm (image=0x8d2d5c0, outfile=0xbfb08654 "image.pnm", force_split=0)
at /home/yang/openjpeg/openjpeg-2.1.2/src/bin/jp2/convert.c:1943
1943 v = *red + adjustR; ++red;

Analysis
image->comps[compno].data = NULL and it was assigned to red, so the program accesses to red, segment fault occurs.

Poc
Contact me if you need Poc file at YangX92@hotmail.com

@Young-X Young-X changed the title NULL Pointer Access in function imagetopnm of convrt.c:1943(jp2) NULL Pointer Access in function imagetopnm of convert.c:1943(jp2) Oct 29, 2016
@1ucian0
Copy link

1ucian0 commented Dec 3, 2016

Please, refer to this issue as CVE-2016-9114

@rouault
Copy link
Collaborator

rouault commented Aug 9, 2017

@Young-X Please verify if that occurs still with latest master. If so, please attach the reproducer to the ticket

@carnil
Copy link

carnil commented Sep 23, 2017

@Young-X can you please provide the reproducer?

@Young-X
Copy link
Author

Young-X commented Oct 24, 2017

There is no crash with latest version and PoC that triggered #857.
Sorry for replying late.

@carnil
Copy link

carnil commented Oct 29, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants