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

Martin v. L?wis loewis@users.sourceforge.net
2001年11月19日 02:41:28 -0800


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv2337
Modified Files:
	socketmodule.c 
Log Message:
Test for negative buffer sizes. Fixes #482871.
Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.195
retrieving revision 1.196
diff -C2 -d -r1.195 -r1.196
*** socketmodule.c	2001年11月09日 10:06:23	1.195
--- socketmodule.c	2001年11月19日 10:41:26	1.196
***************
*** 1482,1485 ****
--- 1482,1490 ----
 	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 によって変換されたページ (->オリジナル) /