mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
bpo-28261: Fixed err msgs where PyArg_ParseTuple is used to parse normal tuples. (#3119)
This commit is contained in:
parent
4bfebc6301
commit
1d1d3e9db8
8 changed files with 67 additions and 19 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue