From: Benjamin Peterson Date: Tue, 21 Feb 2012 05:40:14 +0000 (-0500) Subject: kill interned strings computed before random initialization X-Git-Tag: v2.7.3rc1~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9be6c3ddf09ce4bc5768f708867e6b30a5bc78cb;p=python kill interned strings computed before random initialization --- diff --git a/Modules/main.c b/Modules/main.c index 6d1ae9ed68..824badafbe 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -397,6 +397,12 @@ Py_Main(int argc, char **argv) case 'W': PySys_AddWarnOption(_PyOS_optarg); + /* Extremely obscure hack: if _PyOS_optarg was one character, + PyString_FromString in PySys_AddWarnOption will try to intern + it. This is bad because hash randomization has not been setup + yet, so the string will get the wrong hash. The following call + will cause all the cached characters to be released. */ + PyString_Fini(); break; case 'R':