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

SourceForge.net noreply@sourceforge.net
Sun, 15 Jun 2003 12:26:41 -0700


Bugs item #754870, was opened at 2003-06-15 15:26
Message generated for change (Comment added) made by lemburg
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: Nobody/Anonymous (nobody)
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


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

>Comment By: M.-A. Lemburg (lemburg)
Date: 2003-06-15 21:26

Message:
Logged In: YES 
user_id=38388

Sorry, no time for this.

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

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