mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Fix apparently trivial buffer overflow (SF bug 1060396).
memset() wrote one past the end of the buffer, which was likely to be unused padding or a yet-to-be-initialized local variable. This routine is already tested by test_socket.
This commit is contained in:
parent
f8e74b12b0
commit
80961f3ca9
1 changed files with 1 additions and 1 deletions
|
@ -3351,7 +3351,7 @@ socket_inet_ntop(PyObject *self, PyObject *args)
|
|||
#endif
|
||||
|
||||
/* Guarantee NUL-termination for PyString_FromString() below */
|
||||
memset((void *) &ip[0], '\0', sizeof(ip) + 1);
|
||||
memset((void *) &ip[0], '\0', sizeof(ip));
|
||||
|
||||
if (!PyArg_ParseTuple(args, "is#:inet_ntop", &af, &packed, &len)) {
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue