diff options
| author | Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> | 2024-08-02 14:07:16 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-08-02 14:07:16 (GMT) |
| commit | b20893b5c2dc999bbad5723c20f0ff2aea83a428 (patch) | |
| tree | 06b0ef6a32beac6476011b8f6442688f86a99243 /Python | |
| parent | c1efeb32345e93d423665e91a61ce34a482e0271 (diff) | |
| download | cpython-b20893b5c2dc999bbad5723c20f0ff2aea83a428.zip cpython-b20893b5c2dc999bbad5723c20f0ff2aea83a428.tar.gz cpython-b20893b5c2dc999bbad5723c20f0ff2aea83a428.tar.bz2 | |
[3.13] gh-122334: Fix crash when importing ssl after re-initialization (GH-122481) (#122614)
gh-122334: Fix crash when importing ssl after re-initialization (GH-122481)
* Fix crash when importing ssl after re-initialization
(cherry picked from commit 9fc1c992d6fcea0b7558c581846eef6bdd811f6c)
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
Diffstat (limited to 'Python')
| -rw-r--r-- | Python/getargs.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Python/getargs.c b/Python/getargs.c index 0b27237..f40972f 100644 --- a/Python/getargs.c +++ b/Python/getargs.c @@ -2004,6 +2004,19 @@ parser_clear(struct _PyArg_Parser *parser) if (parser->is_kwtuple_owned) { Py_CLEAR(parser->kwtuple); } + + if (parser->format) { + parser->fname = NULL; + } + else { + assert(parser->fname != NULL); + } + parser->custom_msg = NULL; + parser->pos = 0; + parser->min = 0; + parser->max = 0; + parser->is_kwtuple_owned = 0; + parser->once.v = 0; } static PyObject* |
