From bc0f4f5bd0c7daebb3948b5fbcc5b36745285dc6 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Sat, 17 Jul 2021 12:36:44 +0100 Subject: [PATCH] Regression test for https://github.com/Exiv2/exiv2/security/advisories/GHSA-9jh3-fcc3-g6hv (cherry picked from commit 61cb1a1ca15282bee76c33eb9abdb416ac366471) --- test/data/issue_ghsa_9jh3_fcc3_g6hv_poc.jpg | Bin 0 -> 75 bytes .../github/test_issue_ghsa_9jh3_fcc3_g6hv.py | 21 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 test/data/issue_ghsa_9jh3_fcc3_g6hv_poc.jpg create mode 100644 tests/bugfixes/github/test_issue_ghsa_9jh3_fcc3_g6hv.py diff --git a/test/data/issue_ghsa_9jh3_fcc3_g6hv_poc.jpg b/test/data/issue_ghsa_9jh3_fcc3_g6hv_poc.jpg new file mode 100644 index 0000000000000000000000000000000000000000..df0078afa96d2fd48b72fd283c85736b5d004b3a GIT binary patch literal 75 zcmex=L(hQ0DzDfoH?<^DUrC|Dsv@_bB->WW(9l>(hRK|PMS+2l0SFky8JK|-F9XB> Xw+x&C8Tlpo#Toep3dUglK+&53?GY0z literal 0 HcmV?d00001 diff --git a/tests/bugfixes/github/test_issue_ghsa_9jh3_fcc3_g6hv.py b/tests/bugfixes/github/test_issue_ghsa_9jh3_fcc3_g6hv.py new file mode 100644 index 00000000..430b7a21 --- /dev/null +++ b/tests/bugfixes/github/test_issue_ghsa_9jh3_fcc3_g6hv.py @@ -0,0 +1,21 @@ +# -*- coding: utf-8 -*- + +from system_tests import CaseMeta, CopyTmpFiles, path +@CopyTmpFiles("$data_path/issue_ghsa_9jh3_fcc3_g6hv_poc.jpg") + +class JpegBasePrintStructureInfiniteLoop(metaclass=CaseMeta): + """ + Regression test for the bug described in: + https://github.com/Exiv2/exiv2/security/advisories/GHSA-9jh3-fcc3-g6hv + """ + url = "https://github.com/Exiv2/exiv2/security/advisories/GHSA-9jh3-fcc3-g6hv" + + filename = path("$tmp_path/issue_ghsa_9jh3_fcc3_g6hv_poc.jpg") + commands = ["$exiv2 -d I rm $filename"] + stdout = [""] + stderr = [ +"""Warning: JPEG format error, rc = 2 +Exiv2 exception in erase action for file $filename: +$kerFailedToReadImageData +"""] + retval = [1]