[Python-checkins] python/dist/src/Modules socketmodule.c, 1.310,
1.311
jhylton at users.sourceforge.net
jhylton at users.sourceforge.net
Sun Nov 7 15:24:28 CET 2004
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3103/dist/src/Modules
Modified Files:
socketmodule.c
Log Message:
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.
Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.310
retrieving revision 1.311
diff -u -d -r1.310 -r1.311
--- socketmodule.c 14 Oct 2004 13:27:14 -0000 1.310
+++ socketmodule.c 7 Nov 2004 14:24:25 -0000 1.311
@@ -3351,7 +3351,7 @@
#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;
More information about the Python-checkins
mailing list