Properly initialize all fields of a SSL object after allocation.

This commit is contained in:
Antoine Pitrou 2013-09-29 19:53:45 +02:00
commit b2201e1aa6
2 changed files with 3 additions and 0 deletions

View File

@ -15,6 +15,8 @@ Core and Builtins
Library
-------
- Properly initialize all fields of a SSL object after allocation.
- Issue #19095: SSLSocket.getpeercert() now raises ValueError when the
SSL handshake hasn't been done.

View File

@ -486,6 +486,7 @@ newPySSLSocket(PySSLContext *sslctx, PySocketSockObject *sock,
self->ssl = NULL;
self->Socket = NULL;
self->ctx = sslctx;
self->shutdown_seen_zero = 0;
self->handshake_done = 0;
Py_INCREF(sslctx);