Skip to content

Commit

Permalink
pythongh-101180: PR demonstrating the ASAN failure
Browse files Browse the repository at this point in the history
To make it easy to reproduce. Build your PR branch using:

`./configure --with-address-sanitizer && make`
  • Loading branch information
gpshead committed Feb 8, 2023
1 parent 20cf32e commit 3796c38
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Lib/test/test_codecencodings_jp.py
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()

0 comments on commit 3796c38

Please sign in to comment.