summaryrefslogtreecommitdiff
path: root/lang/python27/patches
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2014-02-09 09:02:50 +0000
committertron <tron@pkgsrc.org>2014-02-09 09:02:50 +0000
commit550a3899196938b33cd5bd5d6115d2be9642e745 (patch)
tree78ce55a29784f04526dcb19f394e38eb4f662fa3 /lang/python27/patches
parenta1075a74341886325eb2a46f475b9ca5e8e93c0f (diff)
downloadpkgsrc-550a3899196938b33cd5bd5d6115d2be9642e745.tar.gz
Add fix for security vulnerability reported in SA56624.
Patch taken from Python Mercurial repository.
Diffstat (limited to 'lang/python27/patches')
-rw-r--r--lang/python27/patches/patch-Modules_socketmodule.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lang/python27/patches/patch-Modules_socketmodule.c b/lang/python27/patches/patch-Modules_socketmodule.c
new file mode 100644
index 00000000000..3af120098ce
--- /dev/null
+++ b/lang/python27/patches/patch-Modules_socketmodule.c
@@ -0,0 +1,19 @@
+$NetBSD: patch-Modules_socketmodule.c,v 1.1 2014/02/09 09:02:50 tron Exp $
+
+Fix vulnerability reported in SA56624. Patch taken from here:
+
+http://hg.python.org/cpython/rev/87673659d8f7
+
+--- Modules/socketmodule.c.orig 2013-11-10 07:36:41.000000000 +0000
++++ Modules/socketmodule.c 2014-02-09 08:41:25.000000000 +0000
+@@ -2742,6 +2742,10 @@
+ if (recvlen == 0) {
+ /* If nbytes was not specified, use the buffer's length */
+ recvlen = buflen;
++ } else if (recvlen > buflen) {
++ PyErr_SetString(PyExc_ValueError,
++ "nbytes is greater than the length of the buffer");
++ goto error;
+ }
+
+ readlen = sock_recvfrom_guts(s, buf.buf, recvlen, flags, &addr);