test_Py_UNICODE_converter(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
- const Py_UNICODE *a;
- const Py_UNICODE *b;
- const Py_UNICODE *c;
- const Py_UNICODE *d;
+ const Py_UNICODE *a = NULL;
+ const Py_UNICODE *b = NULL;
+ const Py_UNICODE *c = NULL;
+ const Py_UNICODE *d = NULL;
Py_ssize_clean_t d_length;
- const Py_UNICODE *e;
+ const Py_UNICODE *e = NULL;
Py_ssize_clean_t e_length;
if (!_PyArg_ParseStack(args, nargs, "O&O&O&u#Z#:test_Py_UNICODE_converter",
Py_ssize_clean_t d_length,
const Py_UNICODE *e,
Py_ssize_clean_t e_length)
-/*[clinic end generated code: output=ef45e982fedf0b3d input=064a3b68ad7f04b0]*/
+/*[clinic end generated code: output=e45007c49e77ad4a input=064a3b68ad7f04b0]*/
/*[clinic input]
--- /dev/null
+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``).
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",
_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;
_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",
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",
exit:
return return_value;
}
-/*[clinic end generated code: output=8e13179bf25bdea5 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d76d0a5901db2e2a input=a9049054013a1b77]*/
PyObject *EventAttributes;
BOOL ManualReset;
BOOL InitialState;
- const Py_UNICODE *Name;
+ const Py_UNICODE *Name = NULL;
if (!_PyArg_ParseStack(args, nargs, "OiiO&:CreateEvent",
&EventAttributes, &ManualReset, &InitialState, _PyUnicode_WideCharString_Opt_Converter, &Name)) {
_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);
exit:
return return_value;
}
-/*[clinic end generated code: output=ee2ec2f93c8d334b input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d3215a6ca589735a input=a9049054013a1b77]*/
static const char * const _keywords[] = {"command", NULL};
static _PyArg_Parser _parser = {NULL, _keywords, "system", 0};
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);
#ifndef OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#define OS_WAITSTATUS_TO_EXITCODE_METHODDEF
#endif /* !defined(OS_WAITSTATUS_TO_EXITCODE_METHODDEF) */
-/*[clinic end generated code: output=73be33fa0000a6d1 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=ddc35c3177c3b3ed input=a9049054013a1b77]*/
{
PyObject *return_value = NULL;
int field;
- const Py_UNICODE *value;
+ const Py_UNICODE *value = NULL;
if (!_PyArg_CheckPositional("SetString", nargs, 2, 2)) {
goto exit;
{
PyObject *return_value = NULL;
int field;
- const Py_UNICODE *value;
+ const Py_UNICODE *value = NULL;
if (!_PyArg_CheckPositional("SetStream", nargs, 2, 2)) {
goto exit;
_msi_Database_OpenView(msiobj *self, PyObject *arg)
{
PyObject *return_value = NULL;
- const Py_UNICODE *sql;
+ const Py_UNICODE *sql = NULL;
if (!PyUnicode_Check(arg)) {
_PyArg_BadArgument("OpenView", "argument", "str", arg);
_msi_OpenDatabase(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
- const Py_UNICODE *path;
+ const Py_UNICODE *path = NULL;
int persist;
if (!_PyArg_CheckPositional("OpenDatabase", nargs, 2, 2)) {
exit:
return return_value;
}
-/*[clinic end generated code: output=49debf733ee5cab2 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=19b24ee4e6420dcd input=a9049054013a1b77]*/
winreg_ConnectRegistry(PyObject *module, PyObject *const *args, Py_ssize_t nargs)
{
PyObject *return_value = NULL;
- const Py_UNICODE *computer_name;
+ const Py_UNICODE *computer_name = NULL;
HKEY key;
HKEY _return_value;
{
PyObject *return_value = NULL;
HKEY key;
- const Py_UNICODE *sub_key;
+ const Py_UNICODE *sub_key = NULL;
HKEY _return_value;
if (!_PyArg_CheckPositional("CreateKey", nargs, 2, 2)) {
static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL};
static _PyArg_Parser _parser = {"O&O&|ii:CreateKeyEx", _keywords, 0};
HKEY key;
- const Py_UNICODE *sub_key;
+ const Py_UNICODE *sub_key = NULL;
int reserved = 0;
REGSAM access = KEY_WRITE;
HKEY _return_value;
{
PyObject *return_value = NULL;
HKEY key;
- const Py_UNICODE *sub_key;
+ const Py_UNICODE *sub_key = NULL;
if (!_PyArg_CheckPositional("DeleteKey", nargs, 2, 2)) {
goto exit;
static const char * const _keywords[] = {"key", "sub_key", "access", "reserved", NULL};
static _PyArg_Parser _parser = {"O&O&|ii:DeleteKeyEx", _keywords, 0};
HKEY key;
- const Py_UNICODE *sub_key;
+ const Py_UNICODE *sub_key = NULL;
REGSAM access = KEY_WOW64_64KEY;
int reserved = 0;
{
PyObject *return_value = NULL;
HKEY key;
- const Py_UNICODE *value;
+ const Py_UNICODE *value = NULL;
if (!_PyArg_CheckPositional("DeleteValue", nargs, 2, 2)) {
goto exit;
winreg_ExpandEnvironmentStrings(PyObject *module, PyObject *arg)
{
PyObject *return_value = NULL;
- const Py_UNICODE *string;
+ const Py_UNICODE *string = NULL;
if (!PyUnicode_Check(arg)) {
_PyArg_BadArgument("ExpandEnvironmentStrings", "argument", "str", arg);
{
PyObject *return_value = NULL;
HKEY key;
- const Py_UNICODE *sub_key;
- const Py_UNICODE *file_name;
+ const Py_UNICODE *sub_key = NULL;
+ const Py_UNICODE *file_name = NULL;
if (!_PyArg_CheckPositional("LoadKey", nargs, 3, 3)) {
goto exit;
static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL};
static _PyArg_Parser _parser = {"O&O&|ii:OpenKey", _keywords, 0};
HKEY key;
- const Py_UNICODE *sub_key;
+ const Py_UNICODE *sub_key = NULL;
int reserved = 0;
REGSAM access = KEY_READ;
HKEY _return_value;
static const char * const _keywords[] = {"key", "sub_key", "reserved", "access", NULL};
static _PyArg_Parser _parser = {"O&O&|ii:OpenKeyEx", _keywords, 0};
HKEY key;
- const Py_UNICODE *sub_key;
+ const Py_UNICODE *sub_key = NULL;
int reserved = 0;
REGSAM access = KEY_READ;
HKEY _return_value;
{
PyObject *return_value = NULL;
HKEY key;
- const Py_UNICODE *sub_key;
+ const Py_UNICODE *sub_key = NULL;
if (!_PyArg_CheckPositional("QueryValue", nargs, 2, 2)) {
goto exit;
{
PyObject *return_value = NULL;
HKEY key;
- const Py_UNICODE *name;
+ const Py_UNICODE *name = NULL;
if (!_PyArg_CheckPositional("QueryValueEx", nargs, 2, 2)) {
goto exit;
{
PyObject *return_value = NULL;
HKEY key;
- const Py_UNICODE *file_name;
+ const Py_UNICODE *file_name = NULL;
if (!_PyArg_CheckPositional("SaveKey", nargs, 2, 2)) {
goto exit;
{
PyObject *return_value = NULL;
HKEY key;
- const Py_UNICODE *sub_key;
+ const Py_UNICODE *sub_key = NULL;
DWORD type;
PyObject *value_obj;
{
PyObject *return_value = NULL;
HKEY key;
- const Py_UNICODE *value_name;
+ const Py_UNICODE *value_name = NULL;
PyObject *reserved;
DWORD type;
PyObject *value;
exit:
return return_value;
}
-/*[clinic end generated code: output=8ce6fb3b6cd46242 input=a9049054013a1b77]*/
+/*[clinic end generated code: output=1c96481d6be5c0d8 input=a9049054013a1b77]*/
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: