Blame tests/bugfixes/github/test_issue_790.py

Packit 01d647
import system_tests
Packit 01d647
Packit 01d647
Packit 01d647
class IntegerOverflowInPngImageReadMetadata(
Packit 01d647
        metaclass=system_tests.CaseMeta):
Packit 01d647
    """
Packit 01d647
    Regression test for the bug described in:
Packit 01d647
    https://github.com/Exiv2/exiv2/issues/790
Packit 01d647
Packit 01d647
    Due to an integer overflow bug (#790), this test triggers an 8GB
Packit 01d647
    memory allocation. So the test will fail with a std::bad_alloc
Packit 01d647
    exception if less than 8GB is available.  On Linux, you can use
Packit 01d647
    `ulimit -v 8000000` to reduce the available memory to slightly
Packit 01d647
    less than 8GB.
Packit 01d647
    """
Packit 01d647
    url = "https://github.com/Exiv2/exiv2/issues/790"
Packit 01d647
Packit 01d647
    filename = system_tests.path(
Packit 01d647
        "$data_path/issue_790_poc2.png"
Packit 01d647
    )
Packit 01d647
    commands = ["$exiv2 $filename"]
Packit 01d647
    stdout = [""]
Packit 01d647
    stderr = ["""Exiv2 exception in print action for file $filename:
Packit 01d647
corrupted image metadata
Packit 01d647
"""
Packit 01d647
]
Packit 01d647
    retval = [1]