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 for segfault in ISO 2022 codecs #44097
Comments
This may relate to bug report 1005078, which was closed Run the following program for a segmentation fault on --CUT HERE--CUT HERE--CUT HERE--CUT HERE--CUT HERE--CUT for x in xrange(0x10000, 0x110000):
if sys.maxunicode >= 0x10000:
ch = unichr(x)
else:
ch = unichr(0xD7C0+(x>>10)) + unichr(0xDC00+(x
& 0x3FF))
try:
# Any ISO 2022 codec will cause the segfault
ch.encode("iso_2022_jp")
except UnicodeEncodeError:
pass
--CUT HERE--CUT HERE--CUT HERE--CUT HERE--CUT HERE--CUT
HERE--CUT HERE-- I have verified this bug on four different Pythons:
It does not just affect iso_2022_jp, but all of the ISO If you are attempting to replicate the bug on Linux,
This seems related to bug report 1005078. However, bug The problem is that four functions in
The enclosed patch adds the necessary checks, and the |
Logged In: YES There's no uploaded file! You have to check the Please try again. (This is a SourceForge annoyance that we can do |
Logged In: YES The upload seems to have quietly failed to work. Also, the Here it is again, with the test program prefixed this time. |
Logged In: YES Thanks for the report. Perky, could you take a look at this patch? I don't know if |
Logged In: YES The patch is correct. Thanks for the report! Applied in svn: |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: