Unverified Kaydet (Commit) ca82e3c0 authored tarafından Miss Islington (bot)'s avatar Miss Islington (bot) Kaydeden (comit) GitHub

bpo-32869: Fix incorrect dst buffer size for MultiByteToWideChar (GH-5739)


This function expects the destination buffer size to be given
in wide characters, not bytes.
(cherry picked from commit b3b4a9d3)
Co-authored-by: 's avatarAlexey Izbyshev <izbyshev@users.noreply.github.com>
üst 2e84e476
......@@ -1289,7 +1289,8 @@ _Py_fopen_obj(PyObject *path, const char *mode)
if (wpath == NULL)
return NULL;
usize = MultiByteToWideChar(CP_ACP, 0, mode, -1, wmode, sizeof(wmode));
usize = MultiByteToWideChar(CP_ACP, 0, mode, -1,
wmode, Py_ARRAY_LENGTH(wmode));
if (usize == 0) {
PyErr_SetFromWindowsErr(0);
return NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment