summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2014-01-14 04:12:55 (GMT)
committerBenjamin Peterson <benjamin@python.org>2014-01-14 04:12:55 (GMT)
commit5688222907583833837f2f0e92205f17fb92d436 (patch)
tree97f45bbb2e1003b76bfe4edb05a61b5a28220cd5 /Modules
parent80602e0e1b543d9f1e08fced125b0ea6c67cdf4b (diff)
parentfbf648ebba32bbc5aa571a4b09e2062a65fd2492 (diff)
downloadcpython-5688222907583833837f2f0e92205f17fb92d436.zip
cpython-5688222907583833837f2f0e92205f17fb92d436.tar.gz
cpython-5688222907583833837f2f0e92205f17fb92d436.tar.bz2
merge 3.2 (#20246)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/socketmodule.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 3bddaa5..e371815 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -2935,6 +2935,11 @@ sock_recvfrom_into(PySocketSockObject *s, PyObject *args, PyObject* kwds)
if (recvlen == 0) {
/* If nbytes was not specified, use the buffer's length */
recvlen = buflen;
+ } else if (recvlen > buflen) {
+ PyBuffer_Release(&pbuf);
+ PyErr_SetString(PyExc_ValueError,
+ "nbytes is greater than the length of the buffer");
+ return NULL;
}
readlen = sock_recvfrom_guts(s, buf, recvlen, flags, &addr);