Skip to content

Commit 3796c38

Browse files
committed
pythongh-101180: PR demonstrating the ASAN failure
To make it easy to reproduce. Build your PR branch using: `./configure --with-address-sanitizer && make`
1 parent 20cf32e commit 3796c38

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

Lib/test/test_codecencodings_jp.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,5 +122,15 @@ class Test_SJISX0213(multibytecodec_support.TestBase, unittest.TestCase):
122122
b"\x85Gℜ\x85Q = ⟨ሴ⟩"
123123
)
124124

125+
126+
class Test_iso2022_jp_2004(unittest.TestCase):
127+
def test_gh101180(self):
128+
import codecs
129+
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'
130+
text = crashfile_txt.decode('utf-8')
131+
# This would trigger a crash or ASAN failure per the original report.
132+
codecs.encode(text, encoding='iso2022_jp_2004', errors='ignore')
133+
134+
125135
if __name__ == "__main__":
126136
unittest.main()

0 commit comments

Comments
 (0)