Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Kirill Smelkov
cpython
Commits
7cfe7ea7
Commit
7cfe7ea7
authored
16 years ago
by
Amaury Forgeot d'Arc
Browse files
Options
Download
Email Patches
Plain Diff
#4317: Fix an Array Bounds Read in imageop.rgb2rgb8.
Will backport to 2.4.
parent
273c233c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
2 deletions
+5
-2
Lib/test/test_imageop.py
Lib/test/test_imageop.py
+2
-1
Misc/NEWS
Misc/NEWS
+2
-0
Modules/imageop.c
Modules/imageop.c
+1
-1
No files found.
Lib/test/test_imageop.py
View file @
7cfe7ea7
...
...
@@ -15,6 +15,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
):
...
...
@@ -26,7 +27,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
...
...
This diff is collapsed.
Click to expand it.
Misc/NEWS
View file @
7cfe7ea7
...
...
@@ -12,6 +12,8 @@ What's New in Python 2.7 alpha 1
Core and Builtins
-----------------
- Issue #4317: Fixed a crash in the imageop.rgb2rgb8() function.
- Issue #4230: If ``__getattr__`` is a descriptor, it now functions correctly.
- Issue #4048: The parser module now correctly validates relative imports.
...
...
This diff is collapsed.
Click to expand it.
Modules/imageop.c
View file @
7cfe7ea7
...
...
@@ -590,7 +590,7 @@ imageop_rgb2rgb8(PyObject *self, PyObject *args)
if
(
!
PyArg_ParseTuple
(
args
,
"s#ii"
,
&
cp
,
&
len
,
&
x
,
&
y
)
)
return
0
;
if
(
!
check_multiply_size
(
len
*
4
,
x
,
"x"
,
y
,
"y"
,
4
)
)
if
(
!
check_multiply_size
(
len
,
x
,
"x"
,
y
,
"y"
,
4
)
)
return
0
;
nlen
=
x
*
y
;
if
(
!
check_multiply
(
nlen
,
x
,
y
)
)
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment