Commit a9b60331 authored by Ben Harper's avatar Ben Harper Committed by T. Wouters

bpo-36253: Remove use after free reference in ctypes test suite (GH-12257)

parent 91210889
......@@ -70,8 +70,8 @@ class StringPtrTestCase(unittest.TestCase):
x = r[0], r[1], r[2], r[3], r[4]
self.assertEqual(x, (b"c", b"d", b"e", b"f", b"\000"))
del buf
# x1 will NOT be the same as x, usually:
x1 = r[0], r[1], r[2], r[3], r[4]
# Because r is a pointer to memory that is freed after deleting buf,
# the pointer is hanging and using it would reference freed memory.
if __name__ == '__main__':
unittest.main()
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment