[Python-checkins] CVS: python/dist/src/Modules socketmodule.c,1.141.2.7,1.141.2.8

Anthony Baxter anthonybaxter@users.sourceforge.net
2001年12月22日 17:44:51 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv12993
Modified Files:
 Tag: release21-maint
	socketmodule.c 
Log Message:
backport of 1.196: socket.recv(-1) fixup.
Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.141.2.7
retrieving revision 1.141.2.8
diff -C2 -d -r1.141.2.7 -r1.141.2.8
*** socketmodule.c	2001年11月01日 14:25:38	1.141.2.7
--- socketmodule.c	2001年12月23日 01:44:49	1.141.2.8
***************
*** 1325,1328 ****
--- 1325,1333 ----
 	if (!PyArg_ParseTuple(args, "i|i:recv", &len, &flags))
 		return NULL;
+ if (len < 0) {
+ 		PyErr_SetString(PyExc_ValueError,
+ 				"negative buffersize in connect");
+ 		return NULL;
+ 	}
 	buf = PyString_FromStringAndSize((char *) 0, len);
 	if (buf == NULL)

AltStyle によって変換されたページ (->オリジナル) /