Add bounds check on allocation size. (#854)

This commit is contained in:
Kevin Backhouse
2019-05-16 08:36:26 +01:00
committed by Luis Díaz Más
parent fe538e9438
commit 80cd0d2990
3 changed files with 38 additions and 3 deletions
+26
View File
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, path
class DenialOfServiceInAdjustTimeOverflow(metaclass=CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/exiv2/issues/853
The date parsing code in XMPUtils::ConvertToDate does not
check that the month and day are in bounds. This can cause a
denial of service in AdjustTimeOverflow because it adjusts
out-of-bounds days in a loop that subtracts one month per
iteration.
"""
url = "https://github.com/Exiv2/exiv2/issues/853"
filename = path("$data_path/issue_853_poc.jpg")
commands = ["$exiv2 $filename"]
stdout = [""]
stderr = [
"""Exiv2 exception in print action for file $filename:
Not a valid ICC Profile
"""]
retval = [1]