bpo-36253: Remove use after free reference in ctypes test suite (GH-1… · python/cpython@a9b6033 (original) (raw)

Skip to content

Provide feedback

Saved searches

Use saved searches to filter your results more quickly

Sign up

Appearance settings

Commit a9b6033

btharperYhg1s

authored and

committed

File tree

1 file changed

lines changed

1 file changed

lines changed

Lines changed: 2 additions & 2 deletions

Original file line number Diff line number Diff line change
@@ -70,8 +70,8 @@ def test_functions(self):
70 70 x = r[0], r[1], r[2], r[3], r[4]
71 71 self.assertEqual(x, (b"c", b"d", b"e", b"f", b"\000"))
72 72 del buf
73 -# x1 will NOT be the same as x, usually:
74 -x1 = r[0], r[1], r[2], r[3], r[4]
73 +# Because r is a pointer to memory that is freed after deleting buf,
74 +# the pointer is hanging and using it would reference freed memory.
75 75
76 76 if __name__ == '__main__':
77 77 unittest.main()