From eeb520bf3950f9e97e18e20e671bb97b513133db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 11 Oct 2018 18:01:38 +0200 Subject: [PATCH 1/3] [testsuite] Add reproducer for second bug from #159 The bug described in the issue got resolved by PR #461 (slices). --- test/data/printStructure2 | Bin 0 -> 12357 bytes tests/bugfixes/github/test_issue_159.py | 50 ++++++------------------ 2 files changed, 13 insertions(+), 37 deletions(-) create mode 100644 test/data/printStructure2 diff --git a/test/data/printStructure2 b/test/data/printStructure2 new file mode 100644 index 0000000000000000000000000000000000000000..97ee450eb6b9d43b2aa48ff80e8879e31fc27782 GIT binary patch literal 12357 zcmeIuyA6df3sMns8H`g+&2pYBC& z>x^?w&QIs(`d`{7=es@gyEzYOx4YgZ)m***rKvjGzs|oMQf>kS2oNAZfB*pk1PBly rK!5-N0t5&UAV7cs0RjXF5FkK+009C72oNAZfB*pk1PBly@DYI(zjOBZ literal 0 HcmV?d00001 diff --git a/tests/bugfixes/github/test_issue_159.py b/tests/bugfixes/github/test_issue_159.py index 72532550..ad9615bc 100644 --- a/tests/bugfixes/github/test_issue_159.py +++ b/tests/bugfixes/github/test_issue_159.py @@ -5,47 +5,23 @@ import system_tests class TestFirstPoC(metaclass=system_tests.CaseMeta): """ - Regression test for the first bug described in: + Regression test for the two bugs described in: https://github.com/Exiv2/exiv2/issues/159 + + We do not actually check the output of these files, we only check that we + don't get a crash (the metadata are bogus anyway, so no point in checking). """ url = "https://github.com/Exiv2/exiv2/issues/159" - filename = "$data_path/printStructure" - commands = ["$exiv2 " + filename] - stdout = [ - """File name : $filename -File size : 12357 Bytes -MIME type : image/tiff -Image size : 0 x 0 -Camera make : -Camera model : -Image timestamp : -Image number : -Exposure time : -Aperture : -Exposure bias : -Flash : -Flash bias : -Focal length : -Subject distance: -ISO speed : -Exposure mode : -Metering mode : -Macro mode : -Image quality : -Exif Resolution : -White balance : -Thumbnail : None -Copyright : -Exif comment : - -""" + filename = [ + system_tests.path("$data_path/printStructure"), + system_tests.path("$data_path/printStructure2") + ] + commands = [ + "$exiv2 " + filename[0], + "$exiv2 -pS " + filename[1], ] - stderr = [""] - retval = [0] + retval = [0, 1] compare_stderr = system_tests.check_no_ASAN_UBSAN_errors - - -# todo: -# class TestSecondPoC(system_tests.Case): + compare_stdout = system_tests.check_no_ASAN_UBSAN_errors From d224f897b063925ed332aad5388196e065d4bb10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 11 Oct 2018 18:28:14 +0200 Subject: [PATCH 2/3] [testsuite] Add reproducer for #216 The bug got resolved by PR #461 (slices). --- ...controlled-recursion_printIFDStructure.tif | Bin 0 -> 64 bytes tests/bugfixes/github/test_issue_216.py | 24 ++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 test/data/exiv2_0-26_exiv2_uncontrolled-recursion_printIFDStructure.tif create mode 100644 tests/bugfixes/github/test_issue_216.py diff --git a/test/data/exiv2_0-26_exiv2_uncontrolled-recursion_printIFDStructure.tif b/test/data/exiv2_0-26_exiv2_uncontrolled-recursion_printIFDStructure.tif new file mode 100644 index 0000000000000000000000000000000000000000..9e50cf9710c49d39c14c064a6f504d4f2cf6cc2b GIT binary patch literal 64 zcmebEWzb?^VBlb2XJlYt2C^7|kb#jI%x2&ago=SA#KCM{uxbVd7KNlrg~S{HLqP)? literal 0 HcmV?d00001 diff --git a/tests/bugfixes/github/test_issue_216.py b/tests/bugfixes/github/test_issue_216.py new file mode 100644 index 00000000..7d7f29a0 --- /dev/null +++ b/tests/bugfixes/github/test_issue_216.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- + +import system_tests + + +class UncontrolledRecursion(metaclass=system_tests.CaseMeta): + url = "https://github.com/Exiv2/exiv2/issues/216" + + filename = system_tests.path( + "$data_path/" + "exiv2_0-26_exiv2_uncontrolled-recursion_printIFDStructure.tif" + ) + + commands = ["$exiv2 -pR $filename"] + retval = [1] + stdout = [ + """STRUCTURE OF TIFF FILE (MM): $filename + address | tag | type | count | offset | value + 10 | 0x0100 ImageWidth | SHORT | 1 | | 1 + 22 | 0x0103 Compression | SHORT | 0 | | + 34 | 000000 GPSVersionID | BYTE | 0 | | """ + ] + + compare_stderr = system_tests.check_no_ASAN_UBSAN_errors From f6d775b400b64fc638afbfc60d068581005eb96f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20=C4=8Cerm=C3=A1k?= Date: Thu, 11 Oct 2018 22:26:52 +0200 Subject: [PATCH 3/3] [testsuite] Add reproducers for #263 This issue got resolved by #180 and #461. --- test/data/10-printStructure-outbound-read-2 | Bin 0 -> 266 bytes test/data/9-printStructure-outbound-read-1 | Bin 0 -> 268 bytes tests/bugfixes/github/test_issue_263.py | 20 ++++++++++++++++++++ 3 files changed, 20 insertions(+) create mode 100644 test/data/10-printStructure-outbound-read-2 create mode 100644 test/data/9-printStructure-outbound-read-1 create mode 100644 tests/bugfixes/github/test_issue_263.py diff --git a/test/data/10-printStructure-outbound-read-2 b/test/data/10-printStructure-outbound-read-2 new file mode 100644 index 0000000000000000000000000000000000000000..f0502caf80e3f4015499c256122b6f92fd19909a GIT binary patch literal 266 zcmZ9GF$%&!5JlhYhG4*G#MUBpPLV2M^#ZouMDSQ?yiy@1kvD~AxOa=AF0Q+2Vn__sVpVeY!mB%K*;pHDV!RZ+K`obPu+VqMcv#6Fk! GY4ibBP!&G_ literal 0 HcmV?d00001 diff --git a/test/data/9-printStructure-outbound-read-1 b/test/data/9-printStructure-outbound-read-1 new file mode 100644 index 0000000000000000000000000000000000000000..126928a4374df7af62dd0efcd37253062bb1c66b GIT binary patch literal 268 zcmZ9HK?=e!5Jlf4S}a(NxKyy~o}%5fL@(ghn+QEtH(sfmf*{nHwr&iBy!`o-`H8V$ z0~|p-52aVa%D7Ut<&;HF+kRmWd9tv|li%tNx~_G0{`>j)2d!PTS0~Os@#QqURso(c zqVFGOe_(X)3}P(uC1*P4(VU3*kM;;b+