Add bounds check on allocation size.
parent
c0ecc2ae36
commit
d3e69f6d2c
Binary file not shown.
After Width: | Height: | Size: 13 KiB |
@ -0,0 +1,23 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from system_tests import CaseMeta, path
|
||||
|
||||
|
||||
class LargeAllocationInPngChunk(metaclass=CaseMeta):
|
||||
"""
|
||||
Regression test for the bug described in:
|
||||
https://github.com/Exiv2/exiv2/issues/845
|
||||
|
||||
An unchecked allocation size causes a std::bad_alloc to
|
||||
be thrown.
|
||||
"""
|
||||
url = "https://github.com/Exiv2/exiv2/issues/845"
|
||||
|
||||
filename = path("$data_path/issue_845_poc.png")
|
||||
commands = ["$exiv2 $filename"]
|
||||
stdout = [""]
|
||||
stderr = [
|
||||
"""$exiv2_exception_message $filename:
|
||||
$kerCorruptedMetadata
|
||||
"""]
|
||||
retval = [1]
|
Loading…
Reference in New Issue