[Python-checkins] cpython (merge 3.3 -> default): Check return value of PyLong_FromLong(X509_get_version()). It might be NULL if

christian.heimes python-checkins at python.org
Fri Jul 26 15:51:43 CEST 2013


http://hg.python.org/cpython/rev/8438a75114e1
changeset:   84839:8438a75114e1
parent:      84837:ad866139a059
parent:      84838:7d6781ec35ea
user:        Christian Heimes <christian at cheimes.de>
date:        Fri Jul 26 15:51:35 2013 +0200
summary:
  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

files:
  Modules/_ssl.c |  2 ++
  1 files changed, 2 insertions(+), 0 deletions(-)


diff --git a/Modules/_ssl.c b/Modules/_ssl.c
--- a/Modules/_ssl.c
+++ b/Modules/_ssl.c
@@ -937,6 +937,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;

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list