diff options
author | Oren Milman <orenmn@gmail.com> | 2017-08-20 15:35:36 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-08-20 15:35:36 (GMT) |
commit | 1d1d3e9db882d78433f5bc8dbe7df929f4b6b5e1 (patch) | |
tree | b5d3ee0a0aba15a2586c4e891630554dd702e933 /Modules/socketmodule.c | |
parent | 4bfebc63012f0f4e00f6a98c3d96e1c0ebe93408 (diff) | |
download | cpython-1d1d3e9db882d78433f5bc8dbe7df929f4b6b5e1.zip cpython-1d1d3e9db882d78433f5bc8dbe7df929f4b6b5e1.tar.gz cpython-1d1d3e9db882d78433f5bc8dbe7df929f4b6b5e1.tar.bz2 |
bpo-28261: Fixed err msgs where PyArg_ParseTuple is used to parse normal tuples. (#3119)
Diffstat (limited to 'Modules/socketmodule.c')
-rw-r--r-- | Modules/socketmodule.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index e18dd32..bf8d19f 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -5972,12 +5972,14 @@ socket_getnameinfo(PyObject *self, PyObject *args) "getnameinfo() argument 1 must be a tuple"); return NULL; } - if (!PyArg_ParseTuple(sa, "si|II", + if (!PyArg_ParseTuple(sa, "si|II;getnameinfo(): illegal sockaddr argument", &hostp, &port, &flowinfo, &scope_id)) + { return NULL; + } if (flowinfo > 0xfffff) { PyErr_SetString(PyExc_OverflowError, - "getsockaddrarg: flowinfo must be 0-1048575."); + "getnameinfo(): flowinfo must be 0-1048575."); return NULL; } PyOS_snprintf(pbuf, sizeof(pbuf), "%d", port); |