Blame tests/bugfixes/github/test_issue_839.py
|
Packit |
01d647 |
# -*- coding: utf-8 -*-
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
from system_tests import CaseMeta, path, check_no_ASAN_UBSAN_errors
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
class OutOfMemoryInLoaderTiffGetData(metaclass=CaseMeta):
|
|
Packit |
01d647 |
"""
|
|
Packit |
01d647 |
Regression test for the bug described in:
|
|
Packit |
01d647 |
https://github.com/Exiv2/exiv2/issues/839
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
Due to a missing bounds check, this test triggers a 4GB memory
|
|
Packit |
01d647 |
allocation. So the test will fail with a std::bad_alloc exception
|
|
Packit |
01d647 |
if less than 4GB is available. On Linux, you can use `ulimit -v
|
|
Packit |
01d647 |
4000000` to reduce the available memory to slightly less than 4GB.
|
|
Packit |
01d647 |
"""
|
|
Packit |
01d647 |
url = "https://github.com/Exiv2/exiv2/issues/839"
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
filename = path("$data_path/issue_839_poc.rw2")
|
|
Packit |
01d647 |
commands = ["$exiv2 $filename"]
|
|
Packit |
01d647 |
stdout = [""]
|
|
Packit |
01d647 |
stderr = [
|
|
Packit |
01d647 |
"""$exiv2_exception_message $filename:
|
|
Packit |
01d647 |
$kerCorruptedMetadata
|
|
Packit |
01d647 |
"""]
|
|
Packit |
01d647 |
compare_stderr = check_no_ASAN_UBSAN_errors
|
|
Packit |
01d647 |
retval = [1]
|