Commit 9bfcaa6f authored by Christian Heimes's avatar Christian Heimes

Check return value of PyLong_FromLong(X509_get_version()). It might be NULL if

X509_get_version() grows beyond our small int cache.
CID 1058279
parents dd6f3899 5962bef8
...@@ -937,6 +937,8 @@ _decode_certificate(X509 *certificate) { ...@@ -937,6 +937,8 @@ _decode_certificate(X509 *certificate) {
Py_DECREF(issuer); Py_DECREF(issuer);
version = PyLong_FromLong(X509_get_version(certificate) + 1); version = PyLong_FromLong(X509_get_version(certificate) + 1);
if (version == NULL)
goto fail0;
if (PyDict_SetItemString(retval, "version", version) < 0) { if (PyDict_SetItemString(retval, "version", version) < 0) {
Py_DECREF(version); Py_DECREF(version);
goto fail0; goto fail0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment