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

jp3d/jpwl convert: fix write stack buffer overflow #1160

Merged
merged 2 commits into from
Nov 16, 2018

Conversation

hlef
Copy link
Contributor

@hlef hlef commented Oct 22, 2018

Missing buffer length formatter in fscanf call might lead to write stack buffer overflow.

(same patch as e528531)

Fixes #1044 (CVE-2017-17480).

Missing buffer length formatter in fscanf call might lead to write
stack buffer overflow.

fixes uclouvain#1044 (CVE-2017-17480)
Tile components in a JP2 image might have null data pointer by defining a
zero component size (for example using large horizontal or vertical
sampling periods). This null data pointer leads to null image component
data pointer, causing crash when dereferenced without != null check in
imagetopnm.

Add != null check.

This commit addresses uclouvain#1152 (CVE-2018-18088).
@hlef
Copy link
Contributor Author

hlef commented Nov 15, 2018

FTR, I have added a second fix addressing #1152. A few comments:

  • The first loop does not seem to be affected (line 2101), there are a few checks earlier during decoding forbidding the first tile to have zero size (not sure this is the expected behavior, but anyways). We might want to add a check there as well to be defensive, but it is not necessary to fix this issue.

  • There might be other places in the code affected by this issue, but this patch does not address them.

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

Successfully merging this pull request may close these issues.

2 participants