]> granicus.if.org Git - python/commitdiff
Properly initialize all fields of a SSL object after allocation.
authorAntoine Pitrou <solipsis@pitrou.net>
Sun, 29 Sep 2013 17:53:45 +0000 (19:53 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Sun, 29 Sep 2013 17:53:45 +0000 (19:53 +0200)
1  2 
Misc/NEWS
Modules/_ssl.c

diff --cc Misc/NEWS
index 48851db01fdf0e4352b20815169ba3f85a030b04,63601d8f11571766d5603da1fd4f762374a96292..8974c4b89fac841460f894b17a160453f4171531
+++ b/Misc/NEWS
@@@ -15,9 -18,61 +15,11 @@@ Core and Builtin
  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.
 +
  - Issue #4366: Fix building extensions on all platforms when --enable-shared
    is used.
  
diff --cc Modules/_ssl.c
index 3afe89308e4e7ca42a9379bdb4c8ddca57415d34,448114bd732b188fa1c7bc755d8aeb231109d9cf..20d02123dd5b0cbb43fcb5f813105ba5a5f69227
@@@ -485,9 -455,7 +485,10 @@@ newPySSLSocket(PySSLContext *sslctx, Py
      self->peer_cert = NULL;
      self->ssl = NULL;
      self->Socket = NULL;
 +    self->ctx = sslctx;
+     self->shutdown_seen_zero = 0;
 +    self->handshake_done = 0;
 +    Py_INCREF(sslctx);
  
      /* Make sure the SSL error state is initialized */
      (void) ERR_get_state();