summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-07-26 13:51:35 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-07-26 13:51:35 (GMT)
commit9bfcaa6fb39358b4aa950e8bd522b1acdf472bba (patch)
treefc295e21c4ac747026095717a857b2b99981f64d
parentdd6f3899f7c83b5a923318a5108f0227b785060a (diff)
parent5962bef8aa1b711c558d92c428c122717ddb5228 (diff)
downloadcpython-9bfcaa6fb39358b4aa950e8bd522b1acdf472bba.zip
cpython-9bfcaa6fb39358b4aa950e8bd522b1acdf472bba.tar.gz
cpython-9bfcaa6fb39358b4aa950e8bd522b1acdf472bba.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
-rw-r--r--Modules/_ssl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_ssl.c b/Modules/_ssl.c
index 4e619b8..116311c 100644
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -937,6 +937,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;