forked from python-pillow/Pillow
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CVE fixes from: python-pillow#4505 Tests for jp2 overflow (cherry picked from commit 30443d3) Format with Black (cherry picked from commit 6e86d23) Add documentation
- Loading branch information
Frederick Price
committed
Apr 19, 2023
1 parent
97671b5
commit 978191b
Showing
6 changed files
with
34 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/usr/bin/env python | ||
|
||
# Reproductions/tests for OOB read errors in FliDecode.c | ||
|
||
# When run in python, all of these images should fail for | ||
# one reason or another, either as a buffer overrun, | ||
# unrecognized datastream, or truncated image file. | ||
# There shouldn't be any segfaults. | ||
# | ||
# if run like | ||
# `valgrind --tool=memcheck python check_jp2_overflow.py 2>&1 | grep Decode.c` | ||
# the output should be empty. There may be python issues | ||
# in the valgrind especially if run in a debug python | ||
# version. | ||
|
||
|
||
from PIL import Image | ||
|
||
repro = ("00r0_gray_l.jp2", "00r1_graya_la.jp2") | ||
|
||
for path in repro: | ||
im = Image.open(path) | ||
try: | ||
im.load() | ||
except Exception as msg: | ||
print(msg) |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters