]> granicus.if.org Git - python/commit
[3.6] bpo-13617: Reject embedded null characters in wchar* strings. (GH-2302) (#2462)
authorSerhiy Storchaka <storchaka@gmail.com>
Wed, 28 Jun 2017 06:27:35 +0000 (09:27 +0300)
committerGitHub <noreply@github.com>
Wed, 28 Jun 2017 06:27:35 +0000 (09:27 +0300)
commit0834905d9b61291b1fc5e05a1ffbc69de9c9379f
tree456e79426ec816ba7e0a0bef7e94a6f8423b2786
parent413c0a92bcc92efe92849fe5e711163da453410b
[3.6] bpo-13617: Reject embedded null characters in wchar* strings. (GH-2302) (#2462)

Based on patch by Victor Stinner.

Add private C API function _PyUnicode_AsUnicode() which is similar to
PyUnicode_AsUnicode(), but checks for null characters..
(cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84)
22 files changed:
Include/unicodeobject.h
Lib/ctypes/test/test_loading.py
Lib/test/test_builtin.py
Lib/test/test_curses.py
Lib/test/test_grp.py
Lib/test/test_imp.py
Lib/test/test_locale.py
Lib/test/test_time.py
Lib/test/test_winsound.py
Modules/_ctypes/callproc.c
Modules/_cursesmodule.c
Modules/_io/fileio.c
Modules/_localemodule.c
Modules/grpmodule.c
Modules/nismodule.c
Modules/posixmodule.c
Modules/pwdmodule.c
Modules/spwdmodule.c
Objects/unicodeobject.c
PC/_msi.c
Python/dynload_win.c
Python/fileutils.c