[Python-checkins] r45303 - python/trunk/Modules/socketmodule.c

armin.rigo python-checkins at python.org
Wed Apr 12 13:59:28 CEST 2006


Author: armin.rigo
Date: Wed Apr 12 13:59:26 2006
New Revision: 45303

Modified:
   python/trunk/Modules/socketmodule.c
Log:
Off-by-one buffer overflow error.


Modified: python/trunk/Modules/socketmodule.c
==============================================================================
--- python/trunk/Modules/socketmodule.c	(original)
+++ python/trunk/Modules/socketmodule.c	Wed Apr 12 13:59:26 2006
@@ -1098,7 +1098,7 @@
 		addr = (struct sockaddr_un*)&(s->sock_addr).un;
 		if (!PyArg_Parse(args, "t#", &path, &len))
 			return 0;
-		if (len > sizeof addr->sun_path) {
+		if (len >= sizeof addr->sun_path) {
 			PyErr_SetString(socket_error,
 					"AF_UNIX path too long");
 			return 0;


More information about the Python-checkins mailing list