summaryrefslogtreecommitdiff
path: root/Python/clinic/import.c.h
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:40 -0800
committerSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:40 -0800
commitb2fa705fd3887c326e811c418469c784353027f4 (patch)
treeb3428f73de91453edbfd4df1a5d4a212d182eb44 /Python/clinic/import.c.h
parent134e58fd3aaa2e91390041e143f3f0a21a60142b (diff)
parentb53654b6dbfce8318a7d4d1cdaddca7a7fec194b (diff)
downloadcpython-b2fa705fd3887c326e811c418469c784353027f4.tar.gz
Issue #29392: Prevent crash when passing invalid arguments into msvcrt module.
Diffstat (limited to 'Python/clinic/import.c.h')
-rw-r--r--Python/clinic/import.c.h29
1 files changed, 19 insertions, 10 deletions
diff --git a/Python/clinic/import.c.h b/Python/clinic/import.c.h
index 05d79ac41b..b3460b061d 100644
--- a/Python/clinic/import.c.h
+++ b/Python/clinic/import.c.h
@@ -89,8 +89,9 @@ _imp__fix_co_filename(PyObject *module, PyObject *args)
PyObject *path;
if (!PyArg_ParseTuple(args, "O!U:_fix_co_filename",
- &PyCode_Type, &code, &path))
+ &PyCode_Type, &code, &path)) {
goto exit;
+ }
return_value = _imp__fix_co_filename_impl(module, code, path);
exit:
@@ -142,8 +143,9 @@ _imp_init_frozen(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
PyObject *name;
- if (!PyArg_Parse(arg, "U:init_frozen", &name))
+ if (!PyArg_Parse(arg, "U:init_frozen", &name)) {
goto exit;
+ }
return_value = _imp_init_frozen_impl(module, name);
exit:
@@ -168,8 +170,9 @@ _imp_get_frozen_object(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
PyObject *name;
- if (!PyArg_Parse(arg, "U:get_frozen_object", &name))
+ if (!PyArg_Parse(arg, "U:get_frozen_object", &name)) {
goto exit;
+ }
return_value = _imp_get_frozen_object_impl(module, name);
exit:
@@ -194,8 +197,9 @@ _imp_is_frozen_package(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
PyObject *name;
- if (!PyArg_Parse(arg, "U:is_frozen_package", &name))
+ if (!PyArg_Parse(arg, "U:is_frozen_package", &name)) {
goto exit;
+ }
return_value = _imp_is_frozen_package_impl(module, name);
exit:
@@ -220,8 +224,9 @@ _imp_is_builtin(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
PyObject *name;
- if (!PyArg_Parse(arg, "U:is_builtin", &name))
+ if (!PyArg_Parse(arg, "U:is_builtin", &name)) {
goto exit;
+ }
return_value = _imp_is_builtin_impl(module, name);
exit:
@@ -246,8 +251,9 @@ _imp_is_frozen(PyObject *module, PyObject *arg)
PyObject *return_value = NULL;
PyObject *name;
- if (!PyArg_Parse(arg, "U:is_frozen", &name))
+ if (!PyArg_Parse(arg, "U:is_frozen", &name)) {
goto exit;
+ }
return_value = _imp_is_frozen_impl(module, name);
exit:
@@ -277,8 +283,9 @@ _imp_create_dynamic(PyObject *module, PyObject *args)
if (!PyArg_UnpackTuple(args, "create_dynamic",
1, 2,
- &spec, &file))
+ &spec, &file)) {
goto exit;
+ }
return_value = _imp_create_dynamic_impl(module, spec, file);
exit:
@@ -308,8 +315,9 @@ _imp_exec_dynamic(PyObject *module, PyObject *mod)
int _return_value;
_return_value = _imp_exec_dynamic_impl(module, mod);
- if ((_return_value == -1) && PyErr_Occurred())
+ if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
+ }
return_value = PyLong_FromLong((long)_return_value);
exit:
@@ -337,8 +345,9 @@ _imp_exec_builtin(PyObject *module, PyObject *mod)
int _return_value;
_return_value = _imp_exec_builtin_impl(module, mod);
- if ((_return_value == -1) && PyErr_Occurred())
+ if ((_return_value == -1) && PyErr_Occurred()) {
goto exit;
+ }
return_value = PyLong_FromLong((long)_return_value);
exit:
@@ -352,4 +361,4 @@ exit:
#ifndef _IMP_EXEC_DYNAMIC_METHODDEF
#define _IMP_EXEC_DYNAMIC_METHODDEF
#endif /* !defined(_IMP_EXEC_DYNAMIC_METHODDEF) */
-/*[clinic end generated code: output=90ad6e5833e6170d input=a9049054013a1b77]*/
+/*[clinic end generated code: output=d24d7f73702a907f input=a9049054013a1b77]*/