diff options
-rw-r--r-- | Misc/NEWS.d/next/Core and Builtins/2021-01-03-04-41-25.bpo-42814.sDvVbb.rst | 1 | ||||
-rw-r--r-- | Objects/genericaliasobject.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2021-01-03-04-41-25.bpo-42814.sDvVbb.rst b/Misc/NEWS.d/next/Core and Builtins/2021-01-03-04-41-25.bpo-42814.sDvVbb.rst new file mode 100644 index 0000000..6978c36 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2021-01-03-04-41-25.bpo-42814.sDvVbb.rst @@ -0,0 +1 @@ +Fix undefined behavior in ``Objects/genericaliasobject.c``. diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c index 4cc82ffc..8fae83b 100644 --- a/Objects/genericaliasobject.c +++ b/Objects/genericaliasobject.c @@ -173,6 +173,7 @@ is_typing_name(PyObject *obj, int num, ...) break; } } + va_end(names); if (!hit) { return 0; } @@ -184,7 +185,6 @@ is_typing_name(PyObject *obj, int num, ...) && _PyUnicode_EqualToASCIIString(module, "typing"); Py_DECREF(module); - va_end(names); return res; } |