Sophie

Sophie

distrib > Mageia > 8 > aarch64 > by-pkgid > 3ccf617a651ec797b0486e4c2f171755 > files > 6

exiv2-0.27.3-1.1.mga8.src.rpm

From 6527e4f5979ced22d509e27d87d51287046f2008 Mon Sep 17 00:00:00 2001
From: Kevin Backhouse <kevinbackhouse@github.com>
Date: Wed, 21 Apr 2021 12:15:50 +0100
Subject: [PATCH] Regression test for
 https://github.com/Exiv2/exiv2/security/advisories/GHSA-8949-hhfh-j7rj
---
 .../github/test_issue_ghsa_8949_hhfh_j7rj.py  | 22 +++++++++++++++++++
 1 file changed, 22 insertions(+)
 create mode 100644 tests/bugfixes/github/test_issue_ghsa_8949_hhfh_j7rj.py

diff --git a/tests/bugfixes/github/test_issue_ghsa_8949_hhfh_j7rj.py b/tests/bugfixes/github/test_issue_ghsa_8949_hhfh_j7rj.py
new file mode 100644
index 0000000..c98b381
--- /dev/null
+++ b/tests/bugfixes/github/test_issue_ghsa_8949_hhfh_j7rj.py
@@ -0,0 +1,22 @@
+# -*- coding: utf-8 -*-
+
+from system_tests import CaseMeta, path
+
+
+class Jp2ImageEncodeJp2HeaderOutOfBoundsRead(metaclass=CaseMeta):
+    """
+    Regression test for the bug described in:
+    https://github.com/Exiv2/exiv2/security/advisories/GHSA-8949-hhfh-j7rj
+    """
+    url = "https://github.com/Exiv2/exiv2/security/advisories/GHSA-8949-hhfh-j7rj"
+
+    filename1 = path("$data_path/issue_ghsa_8949_hhfh_j7rj_poc.jp2")
+    filename2 = path("$data_path/issue_ghsa_8949_hhfh_j7rj_poc.exv")
+    commands = ["$exiv2 in $filename1"]
+    stdout = [""]
+    stderr = [
+"""Error: XMP Toolkit error 201: XML parsing failure
+Warning: Failed to decode XMP metadata.
+$filename1: Could not write metadata to file: $kerCorruptedMetadata
+"""]
+    retval = [1]
-- 
2.25.1