diff options
author | colorfulappl <colorfulappl@qq.com> | 2022-12-17 06:37:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-17 06:37:44 (GMT) |
commit | efbb1eb9f54cad4f7bf5df03eed3a6aba02d99f4 (patch) | |
tree | e33a76ccf9dfad64e82d08d073d86706152758b2 /Lib/test/test_capi | |
parent | 9cdd2fa63b7549d00830bccf19a34e9d69d0b15e (diff) | |
download | cpython-efbb1eb9f54cad4f7bf5df03eed3a6aba02d99f4.zip cpython-efbb1eb9f54cad4f7bf5df03eed3a6aba02d99f4.tar.gz cpython-efbb1eb9f54cad4f7bf5df03eed3a6aba02d99f4.tar.bz2 |
gh-99240: Reset pointer to NULL when the pointed memory is freed in argument parsing (#99890)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Diffstat (limited to 'Lib/test/test_capi')
-rw-r--r-- | Lib/test/test_capi/test_getargs.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_capi/test_getargs.py b/Lib/test/test_capi/test_getargs.py index 1d5c7fb..3792d1a 100644 --- a/Lib/test/test_capi/test_getargs.py +++ b/Lib/test/test_capi/test_getargs.py @@ -1085,6 +1085,10 @@ class String_TestCase(unittest.TestCase): with self.assertWarns(DeprecationWarning): self.assertIsNone(getargs_Z_hash(None)) + def test_gh_99240_clear_args(self): + from _testcapi import gh_99240_clear_args + self.assertRaises(TypeError, gh_99240_clear_args, 'a', '\0b') + class Object_TestCase(unittest.TestCase): def test_S(self): |