diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-01-14 04:14:42 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-01-14 04:14:42 (GMT) |
commit | c6b37e21f513e056b06013a432be715937a27861 (patch) | |
tree | 66264fd38241846b2d9ed4448e92f854bf450ae5 /Modules | |
parent | e74f96ded523fb2fbe977c90093f711ae6bc3d2c (diff) | |
download | cpython-c6b37e21f513e056b06013a432be715937a27861.zip cpython-c6b37e21f513e056b06013a432be715937a27861.tar.gz cpython-c6b37e21f513e056b06013a432be715937a27861.tar.bz2 |
merge 3.3 (#20246)
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/socketmodule.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c index 6c229bc..9cc317f 100644 --- a/Modules/socketmodule.c +++ b/Modules/socketmodule.c @@ -2875,6 +2875,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); |