commit | 5962bef8aa1b711c558d92c428c122717ddb5228 | [log] [tgz] |
---|---|---|
author | Christian Heimes <christian@cheimes.de> | Fri Jul 26 15:51:18 2013 +0200 |
committer | Christian Heimes <christian@cheimes.de> | Fri Jul 26 15:51:18 2013 +0200 |
tree | 3160a86d7ac59f209bf717cb5315710678ac2571 | |
parent | ec2309b03d044a80bdaab4b5b3557fdf82177122 [diff] |
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
diff --git a/Modules/_ssl.c b/Modules/_ssl.c index 434729f..848b962 100644 --- a/Modules/_ssl.c +++ b/Modules/_ssl.c
@@ -903,6 +903,8 @@ 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;