summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-07-26 13:51:18 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-07-26 13:51:18 (GMT)
commit5962bef8aa1b711c558d92c428c122717ddb5228 (patch)
tree3160a86d7ac59f209bf717cb5315710678ac2571 /Modules
parentec2309b03d044a80bdaab4b5b3557fdf82177122 (diff)
downloadcpython-5962bef8aa1b711c558d92c428c122717ddb5228.zip
cpython-5962bef8aa1b711c558d92c428c122717ddb5228.tar.gz
cpython-5962bef8aa1b711c558d92c428c122717ddb5228.tar.bz2
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
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_ssl.c2
1 files changed, 2 insertions, 0 deletions
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 @@ _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;