New submission from Xiang Zhang: Currently PyUnicode_CopyCharacters doesn't check arguments thoroughly. This could lead to undefined behaviour or crash in debug mode. For example, from_start > len(from), how_many < 0. Another case is that when how_many > len(from), it will choose len(from) but this can still fail since from_start can > 0. The doc of it is also not perfect, it does not necessarily return 0 on success.
---------- components: Interpreter Core files: PyUnicode_CopyCharacters.patch keywords: patch messages: 278202 nosy: haypo, serhiy.storchaka, xiang.zhang priority: normal severity: normal stage: patch review status: open title: PyUnicode_CopyCharacters could lead to undefined behaviour type: behavior versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file44989/PyUnicode_CopyCharacters.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28379> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com