-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for buffer overflow in TiffDecode.c CVE-2016-0740
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from helper import unittest, PillowTestCase | ||
from PIL import Image | ||
|
||
TEST_FILE = "Tests/images/libtiff_segfault.tif" | ||
|
||
class TestLibtiffSegfault(PillowTestCase): | ||
def test_segfault(self): | ||
""" This test should not segfault. It will on Pillow <= 3.1.0 and | ||
libtiff >= 4.0.0 | ||
""" | ||
|
||
try: | ||
im = Image.open(TEST_FILE) | ||
im.load() | ||
except IOError: | ||
self.assertTrue(True, "Got expected IOError") | ||
except Exception: | ||
self.fail("Should have returned IOError") | ||
|
||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
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