summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-05-30 11:24:03 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-05-30 11:24:03 (GMT)
commit79851d755bf4edacd3f423c5e2cca21d0c07c3b6 (patch)
treeb059941a272cdf4308fe55c92ec2f48278c97326 /Lib
parent9f1f4f40e460c44cbe236d7db82a4c036aa77770 (diff)
downloadcpython-79851d755bf4edacd3f423c5e2cca21d0c07c3b6.zip
cpython-79851d755bf4edacd3f423c5e2cca21d0c07c3b6.tar.gz
cpython-79851d755bf4edacd3f423c5e2cca21d0c07c3b6.tar.bz2
Issue #21552: Fixed possible integer overflow of too long string lengths in
the tkinter module on 64-bit platforms.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_tcl.py27
1 files changed, 26 insertions, 1 deletions
diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
index c226233..b0b2729 100644
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -557,10 +557,35 @@ class BigmemTclTest(unittest.TestCase):
@support.cpython_only
@unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
@support.bigmemtest(size=INT_MAX + 1, memuse=5, dry_run=False)
- def test_huge_string(self, size):
+ def test_huge_string_call(self, size):
value = ' ' * size
self.assertRaises(OverflowError, self.interp.call, 'set', '_', value)
+ @support.cpython_only
+ @unittest.skipUnless(INT_MAX < PY_SSIZE_T_MAX, "needs UINT_MAX < SIZE_MAX")
+ @support.bigmemtest(size=INT_MAX + 1, memuse=9, dry_run=False)
+ def test_huge_string_builtins(self, size):
+ value = '1' + ' ' * size
+ self.assertRaises(OverflowError, self.interp.getint, value)
+ self.assertRaises(OverflowError, self.interp.getdouble, value)
+ self.assertRaises(OverflowError, self.interp.getboolean, value)
+ self.assertRaises(OverflowError, self.interp.eval, value)
+ self.assertRaises(OverflowError, self.interp.evalfile, value)
+ self.assertRaises(OverflowError, self.interp.record, value)
+ self.assertRaises(OverflowError, self.interp.adderrorinfo, value)
+ self.assertRaises(OverflowError, self.interp.setvar, value, 'x', 'a')
+ self.assertRaises(OverflowError, self.interp.setvar, 'x', value, 'a')
+ self.assertRaises(OverflowError, self.interp.unsetvar, value)
+ self.assertRaises(OverflowError, self.interp.unsetvar, 'x', value)
+ self.assertRaises(OverflowError, self.interp.adderrorinfo, value)
+ self.assertRaises(OverflowError, self.interp.exprstring, value)
+ self.assertRaises(OverflowError, self.interp.exprlong, value)
+ self.assertRaises(OverflowError, self.interp.exprboolean, value)
+ self.assertRaises(OverflowError, self.interp.splitlist, value)
+ self.assertRaises(OverflowError, self.interp.split, value)
+ self.assertRaises(OverflowError, self.interp.createcommand, value, max)
+ self.assertRaises(OverflowError, self.interp.deletecommand, value)
+
def setUpModule():
if support.verbose: