$OpenBSD: patch-Lib_test_test_socket_py,v 1.5 2014/12/14 08:32:55 rpointel Exp $
security fix: http://bugs.python.org/issue20246

--- Lib/test/test_socket.py.orig	Wed Dec 10 16:59:47 2014
+++ Lib/test/test_socket.py	Sat Dec 13 12:13:40 2014
@@ -1694,6 +1694,16 @@ class BufferIOTest(SocketConnectedTest):
 
     _testRecvFromIntoEmptyBuffer = _testRecvFromIntoArray
 
+    def testRecvFromIntoSmallBuffer(self):
+        # See issue #20246.
+        buf = bytearray(8)
+        self.assertRaises(ValueError, self.cli_conn.recvfrom_into, buf, 1024)
+
+    def _testRecvFromIntoSmallBuffer(self):
+        with test_support.check_py3k_warnings():
+            buf = buffer(MSG)
+        self.serv_conn.send(buf)
+
 
 TIPC_STYPE = 2000
 TIPC_LOWER = 200
