Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(117)

Unified Diff: Modules/socketmodule.c

Issue 28261: wrong error messages when using PyArg_ParseTuple to parse normal tuples
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« Modules/overlapped.c ('K') | « Modules/overlapped.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Modules/socketmodule.c Thu Sep 22 11:43:46 2016 +0300
+++ b/Modules/socketmodule.c Fri Sep 23 22:25:22 2016 +0300
@@ -6079,12 +6079,14 @@
"getnameinfo() argument 1 must be a tuple");
return NULL;
}
- if (!PyArg_ParseTuple(sa, "si|II",
- &hostp, &port, &flowinfo, &scope_id))
+ 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);
« Modules/overlapped.c ('K') | « Modules/overlapped.c ('k') | no next file » | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+