diff --git a/test/data/1-out-of-read-Poc b/test/data/1-out-of-read-Poc new file mode 100644 index 00000000..813e4ffb Binary files /dev/null and b/test/data/1-out-of-read-Poc differ diff --git a/tests/bugfixes/github/test_issue_365.py b/tests/bugfixes/github/test_issue_365.py new file mode 100644 index 00000000..8fdd0146 --- /dev/null +++ b/tests/bugfixes/github/test_issue_365.py @@ -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] diff --git a/tests/suite.conf b/tests/suite.conf index 16dc9d67..202d0b99 100644 --- a/tests/suite.conf +++ b/tests/suite.conf @@ -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: