Merge pull request #2384 from kevinbackhouse/fix-issue-2383

Avoid null pointer deref
main
Kevin Backhouse 3 years ago committed by GitHub
commit 03abb2c109
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -834,6 +834,7 @@ void QuickTimeVideo::userDataDecoder(size_t size_external) {
}
else if (equalsQTimeTag(buf, "CMbo") || equalsQTimeTag(buf, "Cmbo")) {
enforce(tv, Exiv2::ErrorCode::kerCorruptedMetadata);
io_->readOrThrow(buf.data(), 2);
buf.data()[2] = '\0';
tv_internal = find(cameraByteOrderTags, Exiv2::toString(buf.data()));

Binary file not shown.

@ -0,0 +1,13 @@
# -*- coding: utf-8 -*-
from system_tests import CaseMeta, check_no_ASAN_UBSAN_errors
class issue_2383_QuickTimeVideo_userDataDecoder_null_deref(metaclass=CaseMeta):
url = "https://github.com/Exiv2/exiv2/issues/2383"
filename = "$data_path/issue_2383_poc.mp4"
commands = ["$exiv2 $filename"]
retval = [1]
stderr = ["""$exiv2_exception_message $filename:
$kerCorruptedMetadata
"""]
stdout = [""]

@ -63,6 +63,7 @@ def get_valid_files(data_dir):
"issue_2366_poc.mp4",
"issue_2376_poc.mp4",
"issue_2377_poc.mp4",
"issue_2383_poc.mp4",
"2018-01-09-exiv2-crash-001.tiff",
"cve_2017_1000126_stack-oob-read.webp",
"exiv2-bug1247.jpg",

Loading…
Cancel
Save