[Python-bugs-list] [ python-Bugs-754870 ] SSL crash interpreter on error

SourceForge.net noreply@sourceforge.net
Sun, 15 Jun 2003 06:26:46 -0700


Bugs item #754870, was opened at 2003-06-15 09:26
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=754870&group_id=5470

Category: Extension Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 6
Submitted By: Neal Norwitz (nnorwitz)
Assigned to: M.-A. Lemburg (lemburg)
Summary: SSL crash interpreter on error

Initial Comment:
When testing bug 739909, I provoked this bug.  To
reproduce:

  # ./python # need to be root to listen on privileged port
  >>> from socket import *
  >>> s = socket(AF_INET, SOCK_STREAM)
  >>> s.bind(('', 993))
  >>> s.listen(5)
  >>> s.accept()

  # now go to another window and do:

  $ ./python
  >>> import imaplib
  >>> imaplib.IMAP4_SSL('localhost')

  # this will wait for the first (root) interpreter
  # exit from first/root interpreter and SSL will crash

There is a stack trace below.

The problem is that in PySSL_SetError(), there is an
assumption that obj->Socket exists, but it doesn't in
this case.

The attached patch  fixes the crash, but I'm not
certain it is correct.

#0  0x4046eaba in PySSL_SetError (obj=0x81e0718, ret=-1)
    at /home/neal/build/python/2_3/Modules/_ssl.c:118
#1  0x4046efed in newPySSLObject (Sock=0x4013f9c8,
key_file=0x0, cert_file=0x0)
    at /home/neal/build/python/2_3/Modules/_ssl.c:259
#2  0x4046f181 in PySocket_ssl (self=0x0, args=0x403e4df4)
    at /home/neal/build/python/2_3/Modules/_ssl.c:296


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=754870&group_id=5470