Add bounds check of resourceSize. (#856)

This commit is contained in:
Kevin Backhouse
2019-05-16 10:24:18 +01:00
committed by Luis Díaz Más
parent 80cd0d2990
commit 1c1436e94e
3 changed files with 33 additions and 2 deletions
+24
View File
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, path
class OutOfMemoryInPsdImageReadMetadata(metaclass=CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/exiv2/issues/855
There is no bounds check on the value of resourceSize,
leading to an out-of-memory error.
"""
url = "https://github.com/Exiv2/exiv2/issues/855"
filename = path("$data_path/issue_855_poc.psd")
commands = ["$exiv2 $filename"]
stdout = [""]
stderr = ["""Warning: Failed to decode IPTC metadata.
Exiv2 exception in print action for file $filename:
corrupted image metadata
"""
]
retval = [1]