Blame tests/bugfixes/github/test_CVE_2017_18005.py
|
Packit |
01d647 |
# -*- coding: utf-8 -*-
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
import system_tests
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
class TestPoC(metaclass=system_tests.CaseMeta):
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
url = "https://github.com/Exiv2/exiv2/issues/168"
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
stderr_common = """Error: Directory Image: IFD exceeds data buffer, cannot read next pointer.
|
|
Packit |
01d647 |
Error: Offset of directory Image, entry 0x0117 is out of bounds: Offset = 0x30303030; truncating the entry
|
|
Packit |
01d647 |
""" + 12 * """Error: Offset of directory Image, entry 0x3030 is out of bounds: Offset = 0x30303030; truncating the entry
|
|
Packit |
01d647 |
"""
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
filename = "$data_path/cve_2017_18005_reproducer.tiff"
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
commands = [
|
|
Packit Service |
fb147c |
"$exiv2 -vPEIXxgklnycsvth -b " + filename,
|
|
Packit |
01d647 |
"$exiv2json " + filename
|
|
Packit |
01d647 |
]
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
stdout = ["""File 1/1: """ + filename + """
|
|
Packit |
01d647 |
0x0117 Image Exif.Image.StripByteCounts StripByteCounts Strip Byte Count SByte 0 0
|
|
Packit |
01d647 |
|
|
Packit |
01d647 |
""",
|
|
Packit |
01d647 |
"""{
|
|
Packit |
01d647 |
"Exif": {
|
|
Packit |
01d647 |
"Image": {
|
|
Packit |
01d647 |
"StripByteCounts": 0,
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": "",
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": 0,
|
|
Packit |
01d647 |
"0x3030": 0
|
|
Packit |
01d647 |
}
|
|
Packit |
01d647 |
}
|
|
Packit |
01d647 |
}
|
|
Packit |
01d647 |
"""
|
|
Packit |
01d647 |
]
|
|
Packit |
01d647 |
stderr = [
|
|
Packit |
01d647 |
stderr_common + filename + """: No IPTC data found in the file
|
|
Packit |
01d647 |
""" + filename + """: No XMP data found in the file
|
|
Packit |
01d647 |
""",
|
|
Packit |
01d647 |
stderr_common
|
|
Packit |
01d647 |
]
|
|
Packit |
01d647 |
retval = [0, 0]
|