Skip to content

Commit

Permalink
Add reproducer for Exiv2#365 to the testsuite
Browse files Browse the repository at this point in the history
  • Loading branch information
D4N committed Jun 11, 2018
1 parent f4e8ed2 commit 9b08354
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Binary file added test/data/1-out-of-read-Poc
Binary file not shown.
22 changes: 22 additions & 0 deletions tests/bugfixes/github/test_issue_365.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-

import system_tests


class AdditionOverflowInLoaderExifJpeg(metaclass=system_tests.CaseMeta):
"""
Regression test for bug #365:
https://github.com/Exiv2/exiv2/issues/365
"""
filename = system_tests.path("$data_path/1-out-of-read-Poc")
commands = ["$exiv2 -ep $filename"]
stdout = [""]
stderr = [
"""Error: Upper boundary of data for directory Image, entry 0x00fe is out of bounds: Offset = 0x0000002a, size = 64, exceeds buffer size by 22 Bytes; truncating the entry
Warning: Directory Image, entry 0x0201: Strip 0 is outside of the data area; ignored.
Warning: Directory Image, entry 0x0201: Strip 7 is outside of the data area; ignored.
Error: Offset of directory Thumbnail, entry 0x0201 is out of bounds: Offset = 0x00000000; truncating the entry
$uncaught_exception $addition_overflow_message
"""
]
retval = [1]
1 change: 1 addition & 0 deletions tests/suite.conf
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ addition_overflow_message: Overflow in addition
exiv2_exception_message: Exiv2 exception in print action for file
exiv2_overflow_exception_message: std::overflow_error exception in print action for file
exception_in_extract: Exiv2 exception in extract action for file
uncaught_exception: Uncaught exception:

0 comments on commit 9b08354

Please sign in to comment.