diff options
author | Georg Brandl <georg@python.org> | 2009-02-13 11:01:07 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-02-13 11:01:07 (GMT) |
commit | 75c3d6ff092f67d1c5aff1d05fcdef1ef1a5bae3 (patch) | |
tree | 6b94d7ef6c2383c31d936c10e31c457656ee6088 /Lib/test/test_struct.py | |
parent | c8dcfb6cece2da41d7b86879af1f4b81f98d70df (diff) | |
download | cpython-75c3d6ff092f67d1c5aff1d05fcdef1ef1a5bae3.zip cpython-75c3d6ff092f67d1c5aff1d05fcdef1ef1a5bae3.tar.gz cpython-75c3d6ff092f67d1c5aff1d05fcdef1ef1a5bae3.tar.bz2 |
#3694: fix an "XXX undetected error" leak in struct.
Diffstat (limited to 'Lib/test/test_struct.py')
-rw-r--r-- | Lib/test/test_struct.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_struct.py b/Lib/test/test_struct.py index 2bc92f3..3d5e028 100644 --- a/Lib/test/test_struct.py +++ b/Lib/test/test_struct.py @@ -524,6 +524,10 @@ class StructTest(unittest.TestCase): self.assertRaises(struct.error, s.pack_into, small_buf, 0, test_string) self.assertRaises(struct.error, s.pack_into, small_buf, 2, test_string) + # Test bogus offset (issue 3694) + sb = small_buf + self.assertRaises(TypeError, struct.pack_into, b'1', sb, None) + def test_pack_into_fn(self): test_string = b'Reykjavik rocks, eow!' writable_buf = array.array('b', b' '*100) |