Commit fba64e1e authored by Martin v. Löwis's avatar Martin v. Löwis

Test for negative buffer sizes. Fixes #482871.

parent 27ae3118
......@@ -1481,6 +1481,11 @@ PySocketSock_recv(PySocketSockObject *s, PyObject *args)
PyObject *buf;
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)
return NULL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment