Author: Matti Picus <[email protected]>
Branch: unicode-utf8-py3
Changeset: r95153:6db0f3da1041
Date: 2018-09-22 19:40 +0300
http://bitbucket.org/pypy/pypy/changeset/6db0f3da1041/
Log: handle bad surrogate pairs
diff --git a/rpython/rlib/rutf8.py b/rpython/rlib/rutf8.py
--- a/rpython/rlib/rutf8.py
+++ b/rpython/rlib/rutf8.py
@@ -759,6 +759,8 @@
if ordch1 <= 0x7F:
self._pos = pos + 1
return ordch1
+ if pos + 1 >= len(code):
+ return ordch1
ordch2 = ord(code[pos+1])
if ordch1 <= 0xDF:
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit