summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2021-01-03 12:18:25 (GMT)
committerGitHub <noreply@github.com>2021-01-03 12:18:25 (GMT)
commit5d3553b0a8959e7505bbec4de03077dbf135ee4b (patch)
treea8d80f5ee428e69ab4e05043aeaa736159b721af /Objects
parent9e8fe1986cb4205fb9f883c89b9d5d76a9847e0b (diff)
downloadcpython-5d3553b0a8959e7505bbec4de03077dbf135ee4b.zip
cpython-5d3553b0a8959e7505bbec4de03077dbf135ee4b.tar.gz
cpython-5d3553b0a8959e7505bbec4de03077dbf135ee4b.tar.bz2
bpo-42814: Fix undefined behavior in Objects/genericaliasobject.c (GH-24073)
In is_typing_name(), va_end() is not always called before the function returns. It is undefined behavior to call va_start() without also calling va_end().
Diffstat (limited to 'Objects')
-rw-r--r--Objects/genericaliasobject.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/genericaliasobject.c b/Objects/genericaliasobject.c
index 4cc82ff..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;
}