From 16dc5f73a511b4cf51baf7eb664a0bc4c1ddf909 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Wed, 21 Jul 2021 19:53:59 +0100 Subject: [PATCH] Regression test for https://github.com/Exiv2/exiv2/security/advisories/GHSA-mvc4-g5pv-4qqq --- test/data/issue_ghsa_mvc4_g5pv_4qqq_poc.jpg | Bin 0 -> 66 bytes .../github/test_issue_ghsa_mvc4_g5pv_4qqq.py | 20 ++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 test/data/issue_ghsa_mvc4_g5pv_4qqq_poc.jpg create mode 100644 tests/bugfixes/github/test_issue_ghsa_mvc4_g5pv_4qqq.py diff --git a/test/data/issue_ghsa_mvc4_g5pv_4qqq_poc.jpg b/test/data/issue_ghsa_mvc4_g5pv_4qqq_poc.jpg new file mode 100644 index 0000000000000000000000000000000000000000..f3d75f95cc039523d6fb122d1b042a07e6cb7a73 GIT binary patch literal 66 zcmex=Q#zd*rQ&w#<)$&;6X VfgyttNH8!6Fy^FI>M{Jk2>@6C71IC! literal 0 HcmV?d00001 diff --git a/tests/bugfixes/github/test_issue_ghsa_mvc4_g5pv_4qqq.py b/tests/bugfixes/github/test_issue_ghsa_mvc4_g5pv_4qqq.py new file mode 100644 index 00000000..14222391 --- /dev/null +++ b/tests/bugfixes/github/test_issue_ghsa_mvc4_g5pv_4qqq.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- + +from system_tests import CaseMeta, CopyTmpFiles, path +@CopyTmpFiles("$data_path/issue_ghsa_mvc4_g5pv_4qqq_poc.jpg") + +class JpegBasePrintStructureInfiniteLoop(metaclass=CaseMeta): + """ + Regression test for the bug described in: + https://github.com/Exiv2/exiv2/security/advisories/GHSA-mvc4-g5pv-4qqq + """ + url = "https://github.com/Exiv2/exiv2/security/advisories/GHSA-mvc4-g5pv-4qqq" + + filename = path("$tmp_path/issue_ghsa_mvc4_g5pv_4qqq_poc.jpg") + commands = ["$exiv2 -d I rm $filename"] + stdout = [""] + stderr = [ +"""Exiv2 exception in erase action for file $filename: +$kerFailedToReadImageData +"""] + retval = [1]