[Python-checkins] python/dist/src/Modules _ssl.c,1.12,1.13

nnorwitz@users.sourceforge.net nnorwitz@users.sourceforge.net
2003年6月29日 20:25:22 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv13018/Modules
Modified Files:
	_ssl.c 
Log Message:
Fix SF #754870, SSL crash interpreter when remote side closes during connect
Also fix a memory leak.
Index: _ssl.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_ssl.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** _ssl.c	28 Jun 2003 07:40:23 -0000	1.12
--- _ssl.c	30 Jun 2003 03:25:19 -0000	1.13
***************
*** 111,115 ****
 		unsigned long e = ERR_get_error();
 		if (e == 0) {
! 			if (ret == 0) {
 				p = PY_SSL_ERROR_EOF;
 				errstr = "EOF occurred in violation of protocol";
--- 111,115 ----
 		unsigned long e = ERR_get_error();
 		if (e == 0) {
! 			if (ret == 0 || !obj->Socket) {
 				p = PY_SSL_ERROR_EOF;
 				errstr = "EOF occurred in violation of protocol";
***************
*** 433,436 ****
--- 433,437 ----
 	if (timedout) {
 		PyErr_SetString(PySSLErrorObject, "The read operation timed out");
+ 		Py_DECREF(buf);
 		return NULL;
 	}

AltStyle によって変換されたページ (->オリジナル) /