]> granicus.if.org Git - python/commit
bpo-33706: Fix pymain_parse_cmdline_impl() (GH-7283)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 31 May 2018 13:43:21 +0000 (06:43 -0700)
committerGitHub <noreply@github.com>
Thu, 31 May 2018 13:43:21 +0000 (06:43 -0700)
commitc6de46e180e81508a3b43341791b56418bd811f9
treea2675aec145df1950db4d9418005c0486bea969d
parentd6bbb57855da3f92521edd901f49705be46fb203
bpo-33706: Fix pymain_parse_cmdline_impl() (GH-7283)

Fix a crash in Python initialization when parsing the command line
options.

Fix memcpy() size parameter: previously, we read one wchar_t after
the end of _PyOS_optarg. Moreover, don't copy the trailingg NUL
character: we write it manually anyway.

Thanks Christoph Gohlke for the bug report and the fix!
(cherry picked from commit 58d1683255abb0df4fc70960da6121aeaa41e1d1)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
Misc/NEWS.d/next/Core and Builtins/2018-05-31-14-50-04.bpo-33706.ztlH04.rst [new file with mode: 0644]
Modules/main.c