Skip to content

gh-101180: PR demonstrating the ASAN failure #101720

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

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Lib/test/test_codecencodings_jp.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,15 @@ class Test_SJISX0213(multibytecodec_support.TestBase, unittest.TestCase):
b"\x85Gℜ\x85Q = ⟨ሴ⟩"
)


class Test_iso2022_jp_2004(unittest.TestCase):
def test_gh101180(self):
import codecs
crashfile_txt = b'8N=d\xcf\x844\x11\x1b\x1b\x0b\x1b\x1b\x1b\x1b\x1b\x1b\x1b\x1b_\x0b\x0b]*\xca\x8c\x01\x00\x00P\x1bK\xf1\x94\xa1\x96'
text = crashfile_txt.decode('utf-8')
# This would trigger a crash or ASAN failure per the original report.
codecs.encode(text, encoding='iso2022_jp_2004', errors='ignore')


if __name__ == "__main__":
unittest.main()