Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/crwimage_int.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ const CrwMapping* CrwMap::crwMapping(uint16_t crwDir, uint16_t crwTagId) {

void CrwMap::decode0x0805(const CiffComponent& ciffComponent, const CrwMapping* /*pCrwMapping*/, Image& image,
ByteOrder /*byteOrder*/) {
std::string s(reinterpret_cast<const char*>(ciffComponent.pData()));
auto s = std::string(reinterpret_cast<const char*>(ciffComponent.pData()), ciffComponent.size());
image.setComment(s);
} // CrwMap::decode0x0805

Expand Down
Binary file added test/data/issue_ghsa_9mxq_4j5g_5wrp.crw
Binary file not shown.
24 changes: 24 additions & 0 deletions tests/bugfixes/github/test_issue_ghsa_9mxq_4j5g_5wrp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8 -*-

from system_tests import CaseMeta, CopyTmpFiles, path


class CrwMap_decode0x0805_OutOfBoundsRead(metaclass=CaseMeta):
"""
Regression test for the bug described in:
https://github.com/Exiv2/exiv2/security/advisories/GHSA-9mxq-4j5g-5wrp
"""

url = "https://github.com/Exiv2/exiv2/security/advisories/GHSA-9mxq-4j5g-5wrp"

filename = path("$data_path/issue_ghsa_9mxq_4j5g_5wrp.crw")
commands = ["$exiv2 $filename"]
stdout = ["""File name : $filename
File size : 74 Bytes
MIME type : image/x-canon-crw
Image size : 0 x 0
"""
]
stderr = ["""$filename: No Exif data found in the file
"""]
retval = [253]
1 change: 1 addition & 0 deletions tests/regression_tests/test_regression_allfiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def get_valid_files(data_dir):
"issue_ghsa_g9xm_7538_mq8w_poc.mov",
"issue_ghsa_38h4_fx85_qcx7_poc.tiff",
"issue_ghsa_496f_x7cq_cq39_poc.jpg",
"issue_ghsa_9mxq_4j5g_5wrp.crw",
"pocIssue283.jpg",
"poc_1522.jp2",
"xmpsdk.xmp",
Expand Down
Loading