From: Jesus Cea Date: Mon, 10 Sep 2012 23:55:04 +0000 (+0200) Subject: Closes #15793: Stack corruption in ssl.RAND_egd(). Python 2.7 hasn't any issue about... X-Git-Tag: v2.7.4rc1~568 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a8a5b397c1a30568be1309ed265b696da84eeca0;p=thirdparty%2FPython%2Fcpython.git Closes #15793: Stack corruption in ssl.RAND_egd(). Python 2.7 hasn't any issue about this, but add a test just to be sure --- diff --git a/Lib/test/test_ssl.py b/Lib/test/test_ssl.py index e643f7493a17..58da942f4923 100644 --- a/Lib/test/test_ssl.py +++ b/Lib/test/test_ssl.py @@ -95,12 +95,8 @@ class BasicSocketTests(unittest.TestCase): sys.stdout.write("\n RAND_status is %d (%s)\n" % (v, (v and "sufficient randomness") or "insufficient randomness")) - 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):