Skip to content

gh-153603: Fix out-of-bounds read in the ISO-2022 decoder for an unknown charset#153604

Open
tonghuaroot wants to merge 1 commit into
python:mainfrom
tonghuaroot:iso2022-setstate-oob
Open

gh-153603: Fix out-of-bounds read in the ISO-2022 decoder for an unknown charset#153604
tonghuaroot wants to merge 1 commit into
python:mainfrom
tonghuaroot:iso2022-setstate-oob

Conversation

@tonghuaroot

Copy link
Copy Markdown
Contributor

The ISO-2022 decoders' designation-table scan compiled its dsg->mark != '\0'
terminator only under Py_DEBUG, so a release build walked off the table for an
unknown charset set via setstate(). Make the terminator unconditional and
report the byte as undecodable when the charset is unknown.

…n unknown charset

The designation-table scan compiled its terminator only under Py_DEBUG, so a
release build walked off the table for an unknown charset set via setstate().
Make the terminator unconditional and report the byte as undecodable.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant