File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed
Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -2063,15 +2063,20 @@ static int check_use_frozen_modules(const char *rawval)
20632063 if (rawval == NULL ) {
20642064 wcscpy (optval , L"frozen_modules" );
20652065 }
2066- else if (swprintf (optval , 100 ,
2067- #if defined(_MSC_VER )
2068- L"frozen_modules=%S" ,
2069- #else
2070- L"frozen_modules=%s" ,
2071- #endif
2072- rawval ) < 0 ) {
2073- error ("rawval is too long" );
2074- return -1 ;
2066+ else {
2067+ wchar_t * val = Py_DecodeLocale (rawval , NULL );
2068+ if (val == NULL ) {
2069+ error ("unable to decode TESTFROZEN" );
2070+ return -1 ;
2071+ }
2072+ wcscpy (optval , L"frozen_modules=" );
2073+ if ((wcslen (optval ) + wcslen (val )) >= Py_ARRAY_LENGTH (optval )) {
2074+ error ("TESTFROZEN is too long" );
2075+ PyMem_RawFree (val );
2076+ return -1 ;
2077+ }
2078+ wcscat (optval , val );
2079+ PyMem_RawFree (val );
20752080 }
20762081
20772082 PyConfig config ;
You can’t perform that action at this time.
0 commit comments