aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Stinner <vstinner@redhat.com>2019-03-19 01:46:25 +0100
committerGitHub <noreply@github.com>2019-03-19 01:46:25 +0100
commit5f9cf23502febe0eb3bc02e45c7d2bfc79424757 (patch)
tree66e3e75c52201876c33fb90c9036420687f60dfb /Python/pathconfig.c
parentbpo-36352: Add error handling to getpath.c (GH-12421) (diff)
downloadcpython-5f9cf23502febe0eb3bc02e45c7d2bfc79424757.tar.gz
cpython-5f9cf23502febe0eb3bc02e45c7d2bfc79424757.tar.bz2
cpython-5f9cf23502febe0eb3bc02e45c7d2bfc79424757.zip
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.
Diffstat (limited to 'Python/pathconfig.c')
-rw-r--r--Python/pathconfig.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Python/pathconfig.c b/Python/pathconfig.c
index 0ee87c42525..87db66b7528 100644
--- a/Python/pathconfig.c
+++ b/Python/pathconfig.c
@@ -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);