summaryrefslogtreecommitdiff
path: root/Modules/_io/winconsoleio.c
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:50 -0800
committerSteve Dower <steve.dower@microsoft.com>2017-02-04 15:05:50 -0800
commit3b0e4320092ac0504b6670cafaf0301b908c91fc (patch)
treed3be1b6b844d61763bb366fa21ceed475e5703fd /Modules/_io/winconsoleio.c
parentb2fa705fd3887c326e811c418469c784353027f4 (diff)
parentf687fbcd73c14dfcbe086eb5cd94b298f1e81e72 (diff)
downloadcpython-3b0e4320092ac0504b6670cafaf0301b908c91fc.tar.gz
Issue #29392: Prevent crash when passing invalid arguments into msvcrt module.
Diffstat (limited to 'Modules/_io/winconsoleio.c')
-rw-r--r--Modules/_io/winconsoleio.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Modules/_io/winconsoleio.c b/Modules/_io/winconsoleio.c
index 7b00a9eb6d..d8e43394bc 100644
--- a/Modules/_io/winconsoleio.c
+++ b/Modules/_io/winconsoleio.c
@@ -85,7 +85,7 @@ char _PyIO_get_console_type(PyObject *path_or_fd) {
Py_CLEAR(decoded);
return '\0';
}
- decoded_upper = PyObject_CallMethod(decoded, "upper", "");
+ decoded_upper = PyObject_CallMethod(decoded, "upper", NULL);
Py_CLEAR(decoded);
if (!decoded_upper) {
PyErr_Clear();
@@ -181,8 +181,8 @@ _io__WindowsConsoleIO_close_impl(winconsoleio *self)
PyObject *exc, *val, *tb;
int rc;
_Py_IDENTIFIER(close);
- res = _PyObject_CallMethodId((PyObject*)&PyRawIOBase_Type,
- &PyId_close, "O", self);
+ res = _PyObject_CallMethodIdObjArgs((PyObject*)&PyRawIOBase_Type,
+ &PyId_close, self, NULL);
if (!self->closehandle) {
self->handle = INVALID_HANDLE_VALUE;
return res;