[Python-checkins] bpo-40479: Fix undefined behavior in Modules/_hashopenssl.c (GH-31153)

miss-islington webhook-mailer at python.org
Mon Feb 7 02:40:59 EST 2022


https://github.com/python/cpython/commit/59e004af63742361b67d1e1ae70229ff0db1059d
commit: 59e004af63742361b67d1e1ae70229ff0db1059d
branch: main
author: Zackery Spytz <zspytz at gmail.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2022-02-06T23:40:54-08:00
summary:

bpo-40479: Fix undefined behavior in Modules/_hashopenssl.c (GH-31153)



va_end() must be called before returning.

files:
A Misc/NEWS.d/next/Core and Builtins/2022-02-06-23-08-30.bpo-40479.zED3Zu.rst
M Modules/_hashopenssl.c

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 0000000000000..52701d53d8fe2
--- /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 fb155b2e62253..bb9487204e741 100644
--- a/Modules/_hashopenssl.c
+++ b/Modules/_hashopenssl.c
@@ -266,6 +266,7 @@ _setException(PyObject *exc, const char* altmsg, ...)
         } else {
             PyErr_FormatV(exc, altmsg, vargs);
         }
+        va_end(vargs);
         return NULL;
     }
     va_end(vargs);



More information about the Python-checkins mailing list