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

Fix NULL pointer dereference in outputSWF_TEXT_RECORD (CVE-2018-6315) #103

Closed
wants to merge 1 commit into from

Conversation

hlef
Copy link
Contributor

@hlef hlef commented Jan 26, 2018

In outputSWF_TEXT_RECORD, the array offset is stored in a signed int, while (&(trec->GlyphEntries[i]))->GlyphIndex[0] returns an unsigned 32 bit number.

This may lead to an integer overflow when reading the offset from the GlyphIndex array, and further to a buffer overflow when doing buffer[i]=fi->fontcodeptr[off] with negative off.

In this commit, we change the type of off to unsigned long so we are guaranteed to be able to store 32 unsigned integers.

This commit fixes CVE-2018-6315 (fixes #101).

In outputSWF_TEXT_RECORD, the array offset is stored in a
signed int, while (&(trec->GlyphEntries[i]))->GlyphIndex[0]
returns an unsigned 32 bit number.

This may lead to an integer overflow when reading the offset
from the GlyphIndex array, and further to a buffer overflow
when doing buffer[i]=fi->fontcodeptr[off] with negative off.

In this commit, we change the type of off to unsigned long so
we are guaranteed to be able to store 32 unsigned integers.

This commit fixes CVE-2018-6315 (fixes libming#101).
@strk
Copy link
Member

strk commented Jan 27, 2018 via email

@hlef
Copy link
Contributor Author

hlef commented Jan 27, 2018

Closing the PR since changes have been merged.

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.

NULL pointer dereference in outputSWF_TEXT_RECORD
2 participants