Blame tests/bugfixes/github/test_issue_857.py

Packit 01d647
# -*- coding: utf-8 -*-
Packit 01d647
Packit 01d647
from system_tests import CaseMeta, path
Packit 01d647
Packit 01d647
Packit 01d647
class OutOfMemoryInRafImageReadMetadata(metaclass=CaseMeta):
Packit 01d647
    """
Packit 01d647
    Regression test for the bug described in:
Packit 01d647
    https://github.com/Exiv2/exiv2/issues/857
Packit 01d647
Packit 01d647
    There is no bounds check on the value of jpg_img_len in
Packit 01d647
    RafImage::readMetadata(), leading to an out-of-memory error.
Packit 01d647
    """
Packit 01d647
    url = "https://github.com/Exiv2/exiv2/issues/857"
Packit 01d647
Packit 01d647
    filename1 = path("$data_path/issue_857_poc.raf")
Packit 01d647
    filename2 = path("$data_path/issue_857_coverage.raf")
Packit 01d647
    commands = ["$exiv2 $filename1", "$exiv2 $filename2"]
Packit 01d647
    stdout = ["", ""]
Packit 01d647
    stderr = [
Packit 01d647
"""Exiv2 exception in print action for file $filename1:
Packit 01d647
$kerCorruptedMetadata
Packit 01d647
""",
Packit 01d647
"""Exiv2 exception in print action for file $filename2:
Packit 01d647
This does not look like a TIFF image
Packit 01d647
"""
Packit 01d647
]
Packit 01d647
    retval = [1,1]