diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2022-10-03 07:42:54 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-03 07:42:54 (GMT) |
commit | 0ee9619a4cba58730c45e65d22288fadbf7680de (patch) | |
tree | fa6e5a5a263935824930a46f1411a5da00857ce5 /Modules/clinic | |
parent | e738b5190bfa63086b5e8169189e9b05302873c8 (diff) | |
download | cpython-0ee9619a4cba58730c45e65d22288fadbf7680de.zip cpython-0ee9619a4cba58730c45e65d22288fadbf7680de.tar.gz cpython-0ee9619a4cba58730c45e65d22288fadbf7680de.tar.bz2 |
gh-97728: Argument Clinic: Fix uninitialized variable in the Py_UNICODE converter (GH-97729)
It affects function os.system() on Windows and Windows-specific modules
winreg, _winapi, _overlapped, and _msi.
Diffstat (limited to 'Modules/clinic')
-rw-r--r-- | Modules/clinic/_winapi.c.h | 18 | ||||
-rw-r--r-- | Modules/clinic/overlapped.c.h | 6 | ||||
-rw-r--r-- | Modules/clinic/posixmodule.c.h | 4 |
3 files changed, 14 insertions, 14 deletions
diff --git a/Modules/clinic/_winapi.c.h b/Modules/clinic/_winapi.c.h index 53d5ccc..cc1a588 100644 --- a/Modules/clinic/_winapi.c.h +++ b/Modules/clinic/_winapi.c.h @@ -221,7 +221,7 @@ _winapi_CreateFileMapping(PyObject *module, PyObject *const *args, Py_ssize_t na DWORD protect; DWORD max_size_high; DWORD max_size_low; - LPCWSTR name; + LPCWSTR name = NULL; HANDLE _return_value; if (!_PyArg_ParseStack(args, nargs, "" F_HANDLE "" F_POINTER "kkkO&:CreateFileMapping", @@ -260,8 +260,8 @@ static PyObject * _winapi_CreateJunction(PyObject *module, PyObject *const *args, Py_ssize_t nargs) { PyObject *return_value = NULL; - LPCWSTR src_path; - LPCWSTR dst_path; + LPCWSTR src_path = NULL; + LPCWSTR dst_path = NULL; if (!_PyArg_CheckPositional("CreateJunction", nargs, 2, 2)) { goto exit; @@ -409,14 +409,14 @@ static PyObject * _winapi_CreateProcess(PyObject *module, PyObject *const *args, Py_ssize_t nargs) { PyObject *return_value = NULL; - const Py_UNICODE *application_name; + const Py_UNICODE *application_name = NULL; PyObject *command_line; PyObject *proc_attrs; PyObject *thread_attrs; BOOL inherit_handles; DWORD creation_flags; PyObject *env_mapping; - const Py_UNICODE *current_directory; + const Py_UNICODE *current_directory = NULL; PyObject *startup_info; if (!_PyArg_ParseStack(args, nargs, "O&OOOikOO&O:CreateProcess", @@ -760,7 +760,7 @@ _winapi_OpenFileMapping(PyObject *module, PyObject *const *args, Py_ssize_t narg PyObject *return_value = NULL; DWORD desired_access; BOOL inherit_handle; - LPCWSTR name; + LPCWSTR name = NULL; HANDLE _return_value; if (!_PyArg_ParseStack(args, nargs, "kiO&:OpenFileMapping", @@ -890,9 +890,9 @@ _winapi_LCMapStringEx(PyObject *module, PyObject *const *args, Py_ssize_t nargs, .kwtuple = KWTUPLE, }; #undef KWTUPLE - LPCWSTR locale; + LPCWSTR locale = NULL; DWORD flags; - LPCWSTR src; + LPCWSTR src = NULL; if (!_PyArg_ParseStackAndKeywords(args, nargs, kwnames, &_parser, _PyUnicode_WideCharString_Converter, &locale, &flags, _PyUnicode_WideCharString_Converter, &src)) { @@ -1345,4 +1345,4 @@ _winapi__mimetypes_read_windows_registry(PyObject *module, PyObject *const *args exit: return return_value; } -/*[clinic end generated code: output=3e51e0b2ea3fea5a input=a9049054013a1b77]*/ +/*[clinic end generated code: output=83c4a3f0e70e7775 input=a9049054013a1b77]*/ diff --git a/Modules/clinic/overlapped.c.h b/Modules/clinic/overlapped.c.h index cc0c74c..e8c2fe5 100644 --- a/Modules/clinic/overlapped.c.h +++ b/Modules/clinic/overlapped.c.h @@ -282,7 +282,7 @@ _overlapped_CreateEvent(PyObject *module, PyObject *const *args, Py_ssize_t narg PyObject *EventAttributes; BOOL ManualReset; BOOL InitialState; - const Py_UNICODE *Name; + const Py_UNICODE *Name = NULL; if (!_PyArg_CheckPositional("CreateEvent", nargs, 4, 4)) { goto exit; @@ -1047,7 +1047,7 @@ static PyObject * _overlapped_Overlapped_ConnectPipe(OverlappedObject *self, PyObject *arg) { PyObject *return_value = NULL; - const Py_UNICODE *Address; + const Py_UNICODE *Address = NULL; if (!PyUnicode_Check(arg)) { _PyArg_BadArgument("ConnectPipe", "argument", "str", arg); @@ -1254,4 +1254,4 @@ exit: return return_value; } -/*[clinic end generated code: output=ed7ca699b5cf6260 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=e0f866222bd5873b input=a9049054013a1b77]*/ diff --git a/Modules/clinic/posixmodule.c.h b/Modules/clinic/posixmodule.c.h index a26cb82..7fac078 100644 --- a/Modules/clinic/posixmodule.c.h +++ b/Modules/clinic/posixmodule.c.h @@ -2399,7 +2399,7 @@ os_system(PyObject *module, PyObject *const *args, Py_ssize_t nargs, PyObject *k }; #undef KWTUPLE PyObject *argsbuf[1]; - const Py_UNICODE *command; + const Py_UNICODE *command = NULL; long _return_value; args = _PyArg_UnpackKeywords(args, nargs, NULL, kwnames, &_parser, 1, 1, 0, argsbuf); @@ -11367,4 +11367,4 @@ exit: #ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF #define OS_WAITSTATUS_TO_EXITCODE_METHODDEF #endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */ -/*[clinic end generated code: output=dc71eece3fc988a7 input=a9049054013a1b77]*/ +/*[clinic end generated code: output=dd43d388b442c96d input=a9049054013a1b77]*/ |