summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_array.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-07-26 05:49:37 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-07-26 05:49:37 (GMT)
commitcf74c1996e084aa840db0782da833f640a3923e3 (patch)
treec6c1f2619f71dceb38bab0f5671cdec207062d63 /Lib/test/test_array.py
parent7f18ac4a5962365a948d118176075e2ca045fdc7 (diff)
downloadcpython-cf74c1996e084aa840db0782da833f640a3923e3.zip
cpython-cf74c1996e084aa840db0782da833f640a3923e3.tar.gz
cpython-cf74c1996e084aa840db0782da833f640a3923e3.tar.bz2
Issue #24613: Calling array.fromstring() with self is no longer allowed
to prevent the use-after-free error. Patch by John Leitch.
Diffstat (limited to 'Lib/test/test_array.py')
-rw-r--r--Lib/test/test_array.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/test/test_array.py b/Lib/test/test_array.py
index 105cf73..9f5c09d 100644
--- a/Lib/test/test_array.py
+++ b/Lib/test/test_array.py
@@ -247,6 +247,7 @@ class BaseTest(unittest.TestCase):
self.assertRaises(TypeError, a.tostring, 42)
self.assertRaises(TypeError, b.fromstring)
self.assertRaises(TypeError, b.fromstring, 42)
+ self.assertRaises(ValueError, a.fromstring, a)
b.fromstring(a.tostring())
self.assertEqual(a, b)
if a.itemsize>1: