mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-36301: Error if decoding pybuilddir.txt fails (GH-12422)
Python initialization now fails if decoding pybuilddir.txt configuration file fails at startup. _PyPathConfig_Calculate() now reports memory allocation failure and decoding error on decoding pybuilddir.txt content from UTF-8/surrogateescape.
This commit is contained in:
parent
7b14f0c02c
commit
5f9cf23502
5 changed files with 32 additions and 16 deletions
|
@ -712,7 +712,7 @@ _Py_FindEnvConfigValue(FILE *env_file, const wchar_t *key,
|
|||
continue;
|
||||
}
|
||||
|
||||
wchar_t *tmpbuffer = _Py_DecodeUTF8_surrogateescape(buffer, n);
|
||||
wchar_t *tmpbuffer = _Py_DecodeUTF8_surrogateescape(buffer, n, NULL);
|
||||
if (tmpbuffer) {
|
||||
wchar_t * state;
|
||||
wchar_t * tok = WCSTOK(tmpbuffer, L" \t\r\n", &state);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue