summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorJeremy Hylton <jeremy@alum.mit.edu>2004-11-07 14:24:25 (GMT)
committerJeremy Hylton <jeremy@alum.mit.edu>2004-11-07 14:24:25 (GMT)
commit80961f3ca90ab48470fad8bb2310f19896ec9b7b (patch)
tree354b6b4ffd9fe6c2cf721e5d517911f405aab5c4 /Modules
parentf8e74b12b00401b9cd6322fc339a1b9111e944df (diff)
downloadcpython-80961f3ca90ab48470fad8bb2310f19896ec9b7b.zip
cpython-80961f3ca90ab48470fad8bb2310f19896ec9b7b.tar.gz
cpython-80961f3ca90ab48470fad8bb2310f19896ec9b7b.tar.bz2
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.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/socketmodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index e239caf..3c17e9c 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -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;