STINNER Victor <victor.stin...@haypocalc.com> added the comment: New version without the hardcoded limit: don't use goto encodeUCS4;, chain if to limit indentation depth: it only costs one copy of the UCS4 (5 lines are duplicated).
The buffer is now reallocated each time a surrogate escape is longer than 4 bytes. I don't know if "nallocated += repsize - 4;" can overflow or not. If yes, how can I detect the overflow? I added: /* FIXME: check integer overflow? */ ---------- Added file: http://bugs.python.org/file17010/utf8_surrogate_error-2.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8092> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com