mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
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
This commit is contained in:
parent
ec2309b03d
commit
5962bef8aa
1 changed files with 2 additions and 0 deletions
|
|
@ -903,6 +903,8 @@ _decode_certificate(X509 *certificate) {
|
|||
Py_DECREF(issuer);
|
||||
|
||||
version = PyLong_FromLong(X509_get_version(certificate) + 1);
|
||||
if (version == NULL)
|
||||
goto fail0;
|
||||
if (PyDict_SetItemString(retval, "version", version) < 0) {
|
||||
Py_DECREF(version);
|
||||
goto fail0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue