Skip to content

Commit

Permalink
pythongh-97728: Argument Clinic: Fix uninitialized variable in the Py…
Browse files Browse the repository at this point in the history
…_UNICODE converter

It affects function os.system() on Windows and Windows-specific modules
winreg, _winapi, _overlapped, and _msi.
  • Loading branch information
serhiy-storchaka committed Oct 2, 2022
1 parent e8165d4 commit 96a7768
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Fix possible crashes caused by the use of uninitialized variables when pass
invalid arguments in :func:`os.system` on Windows and in Windows-specific
modules (like ``winreg``).
18 changes: 9 additions & 9 deletions Modules/clinic/_winapi.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Modules/clinic/overlapped.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Modules/clinic/posixmodule.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions PC/clinic/_msi.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 17 additions & 17 deletions PC/clinic/winreg.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Tools/clinic/clinic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3586,6 +3586,7 @@ def converter_init(self, *, accept={str}, zeroes=False):
self.converter = '_PyUnicode_WideCharString_Opt_Converter'
else:
fail("Py_UNICODE_converter: illegal 'accept' argument " + repr(accept))
self.c_default = "NULL"

def cleanup(self):
if not self.length:
Expand Down

0 comments on commit 96a7768

Please sign in to comment.