[pypy-commit] pypy py3k: fix _SSLContext invalid protocol errors not ensuring a self.ctx, leading to a

pjenvey noreply at buildbot.pypy.org
Fri Oct 17 22:12:43 CEST 2014


Author: Philip Jenvey <pjenvey at underboss.org>
Branch: py3k
Changeset: r74003:c1ddf2d919a1
Date: 2014-10-17 13:09 -0700
http://bitbucket.org/pypy/pypy/changeset/c1ddf2d919a1/

Log:	fix _SSLContext invalid protocol errors not ensuring a self.ctx,
	leading to a potential crash in its destructor

diff --git a/pypy/module/_ssl/interp_ssl.py b/pypy/module/_ssl/interp_ssl.py
--- a/pypy/module/_ssl/interp_ssl.py
+++ b/pypy/module/_ssl/interp_ssl.py
@@ -90,6 +90,8 @@
 
 
 class SSLContext(W_Root):
+    ctx = lltype.nullptr(SSL_CTX.TO)
+
     def __init__(self, space, protocol):
         if protocol == PY_SSL_VERSION_TLS1:
             method = libssl_TLSv1_method()


More information about the pypy-commit mailing list