fix incorrect loop condition (#1752)

This commit is contained in:
Kevin Backhouse
2021-07-01 12:33:20 +01:00
committed by Christoph Hasse
parent 5ab3f2b0c5
commit d30c95d07e
4 changed files with 24 additions and 7 deletions
@@ -1,7 +1,7 @@
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, path
from system_tests import CaseMeta, CopyTmpFiles, path
@CopyTmpFiles("$data_path/issue_ghsa_8949_hhfh_j7rj_poc.jp2","$data_path/issue_ghsa_8949_hhfh_j7rj_poc.exv")
class Jp2ImageEncodeJp2HeaderOutOfBoundsRead(metaclass=CaseMeta):
"""
@@ -10,13 +10,12 @@ class Jp2ImageEncodeJp2HeaderOutOfBoundsRead(metaclass=CaseMeta):
"""
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")
filename1 = path("$tmp_path/issue_ghsa_8949_hhfh_j7rj_poc.jp2")
filename2 = path("$tmp_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]
retval = [0]
@@ -0,0 +1,18 @@
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, CopyTmpFiles, path, check_no_ASAN_UBSAN_errors
@CopyTmpFiles("$data_path/issue_ghsa_mxw9_qx4c_6m8v_poc.jp2")
class Jp2ImageEncodeJp2HeaderOutOfBoundsRead2(metaclass=CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/exiv2/security/advisories/GHSA-mxw9-qx4c-6m8v
"""
url = "https://github.com/Exiv2/exiv2/security/advisories/GHSA-mxw9-qx4c-6m8v"
filename = path("$tmp_path/issue_ghsa_mxw9_qx4c_6m8v_poc.jp2")
commands = ["$exiv2 rm $filename"]
stdout = [""]
retval = [0]
compare_stderr = check_no_ASAN_UBSAN_errors