summaryrefslogtreecommitdiff
path: root/Lib/test/test_imageop.py
diff options
context:
space:
mode:
authorAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-11-18 22:35:48 +0000
committerAmaury Forgeot d'Arc <amauryfa@gmail.com>2008-11-18 22:35:48 +0000
commitef633d7c5dcad78976350ce8212b7a41a8c7b74c (patch)
treebb02e401fd96d51d57c7c0c74dace1bf67d2ab63 /Lib/test/test_imageop.py
parent42fe1a2ff864c3f3491e6dab38b24e27db304633 (diff)
downloadcpython-git-ef633d7c5dcad78976350ce8212b7a41a8c7b74c.tar.gz
#4317: Fix an Array Bounds Read in imageop.rgb2rgb8.
Backport of r67266
Diffstat (limited to 'Lib/test/test_imageop.py')
-rwxr-xr-xLib/test/test_imageop.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/test/test_imageop.py b/Lib/test/test_imageop.py
index f57757f270..476b379de3 100755
--- a/Lib/test/test_imageop.py
+++ b/Lib/test/test_imageop.py
@@ -19,6 +19,7 @@ SIZES = (1, 2, 3, 4)
_VALUES = (1, 2, 2**10, 2**15-1, 2**15, 2**15+1, 2**31-2, 2**31-1)
VALUES = tuple( -x for x in reversed(_VALUES) ) + (0,) + _VALUES
AAAAA = "A" * 1024
+MAX_LEN = 2**20
class InputValidationTests(unittest.TestCase):
@@ -30,7 +31,7 @@ class InputValidationTests(unittest.TestCase):
strlen = abs(width * height)
if size:
strlen *= size
- if strlen < 1024:
+ if strlen < MAX_LEN:
data = "A" * strlen
else:
data = AAAAA