commit
9cddfa514d
@ -268,7 +268,12 @@ namespace Exiv2
|
||||
#endif
|
||||
|
||||
const long pad = 3 ; // 3 padding bytes 2 0 0
|
||||
DataBuf data(Safe::add(subBox.length, static_cast<uint32_t>(8)));
|
||||
const size_t data_length = Safe::add(subBox.length, static_cast<uint32_t>(8));
|
||||
// data_length makes no sense if it is larger than the rest of the file
|
||||
if (data_length > io_->size() - io_->tell()) {
|
||||
throw Error(58);
|
||||
}
|
||||
DataBuf data(data_length);
|
||||
io_->read(data.pData_,data.size_);
|
||||
const long iccLength = getULong(data.pData_+pad, bigEndian);
|
||||
// subtracting pad from data.size_ is safe:
|
||||
|
||||
BIN
test/data/exiv2-memorymmap-error
Normal file
BIN
test/data/exiv2-memorymmap-error
Normal file
Binary file not shown.
18
tests/bugfixes/github/test_CVE_2018_4868.py
Normal file
18
tests/bugfixes/github/test_CVE_2018_4868.py
Normal file
@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import system_tests
|
||||
|
||||
|
||||
class TestCvePoC(system_tests.Case):
|
||||
|
||||
url = "https://github.com/Exiv2/exiv2/issues/202"
|
||||
cve_url = "http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-4868"
|
||||
found_by = ["afl", "topsecLab", "xcainiao"]
|
||||
|
||||
filename = "{data_path}/exiv2-memorymmap-error"
|
||||
commands = ["{exiv2} " + filename]
|
||||
stdout = [""]
|
||||
stderr = ["""{exiv2_exception_msg} """ + filename + """:
|
||||
{error_58_message}
|
||||
"""]
|
||||
retval = [1]
|
||||
Loading…
Reference in New Issue
Block a user