changeset: 78984:7619a400d318 parent: 78981:306b2ecb1a3e parent: 78983:827bb0554f1f user: Jesus Cea date: Tue Sep 11 02:08:48 2012 +0200 files: Lib/test/test_ssl.py Misc/NEWS Modules/_ssl.c description: MERGE: Closes #15793: Stack corruption in ssl.RAND_egd() diff -r 306b2ecb1a3e -r 7619a400d318 Lib/test/test_ssl.py --- a/Lib/test/test_ssl.py Mon Sep 10 22:58:35 2012 +0200 +++ b/Lib/test/test_ssl.py Tue Sep 11 02:08:48 2012 +0200 @@ -125,12 +125,8 @@ else: self.assertRaises(ssl.SSLError, ssl.RAND_bytes, 16) - try: - ssl.RAND_egd(1) - except TypeError: - pass - else: - print("didn't raise TypeError") + self.assertRaises(TypeError, ssl.RAND_egd, 1) + self.assertRaises(TypeError, ssl.RAND_egd, 'foo', 1) ssl.RAND_add("this is a random string", 75.0) def test_parse_cert(self): diff -r 306b2ecb1a3e -r 7619a400d318 Misc/NEWS --- a/Misc/NEWS Mon Sep 10 22:58:35 2012 +0200 +++ b/Misc/NEWS Tue Sep 11 02:08:48 2012 +0200 @@ -210,6 +210,9 @@ - Issue #13579: string.Formatter now understands the 'a' conversion specifier. +- Issue #15793: Stack corruption in ssl.RAND_egd(). + Patch by Serhiy Storchaka. + - Issue #15595: Fix subprocess.Popen(universal_newlines=True) for certain locales (utf-16 and utf-32 family). Patch by Chris Jerdonek. diff -r 306b2ecb1a3e -r 7619a400d318 Modules/_ssl.c --- a/Modules/_ssl.c Mon Sep 10 22:58:35 2012 +0200 +++ b/Modules/_ssl.c Tue Sep 11 02:08:48 2012 +0200 @@ -2481,7 +2481,7 @@ PyObject *path; int bytes; - if (!PyArg_ParseTuple(args, "O&|i:RAND_egd", + if (!PyArg_ParseTuple(args, "O&:RAND_egd", PyUnicode_FSConverter, &path)) return NULL;

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