From 4749a1584777686a34a2b1d09d5ff1e3b5ee517d Mon Sep 17 00:00:00 2001 From: Zackery Spytz Date: Sun, 6 Feb 2022 23:40:54 -0800 Subject: [PATCH] bpo-40479: Fix undefined behavior in Modules/_hashopenssl.c (GH-31153) va_end() must be called before returning. (cherry picked from commit 59e004af63742361b67d1e1ae70229ff0db1059d) Co-authored-by: Zackery Spytz --- .../Core and Builtins/2022-02-06-23-08-30.bpo-40479.zED3Zu.rst | 1 + Modules/_hashopenssl.c | 1 + 2 files changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Core and Builtins/2022-02-06-23-08-30.bpo-40479.zED3Zu.rst diff --git a/Misc/NEWS.d/next/Core and Builtins/2022-02-06-23-08-30.bpo-40479.zED3Zu.rst b/Misc/NEWS.d/next/Core and Builtins/2022-02-06-23-08-30.bpo-40479.zED3Zu.rst new file mode 100644 index 00000000000000..52701d53d8fe21 --- /dev/null +++ b/Misc/NEWS.d/next/Core and Builtins/2022-02-06-23-08-30.bpo-40479.zED3Zu.rst @@ -0,0 +1 @@ +Add a missing call to ``va_end()`` in ``Modules/_hashopenssl.c``. diff --git a/Modules/_hashopenssl.c b/Modules/_hashopenssl.c index a4889450821878..4873bb11aa0cd6 100644 --- a/Modules/_hashopenssl.c +++ b/Modules/_hashopenssl.c @@ -311,6 +311,7 @@ _setException(PyObject *exc, const char* altmsg, ...) } else { PyErr_FormatV(exc, altmsg, vargs); } + va_end(vargs); return NULL; } va_end(vargs);