Skip to content

Commit

Permalink
Allow c_data() to return zero byte buffer.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinbackhouse committed Jun 17, 2023
1 parent b66ebd9 commit b2808bc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ const byte* Exiv2::DataBuf::c_data(size_t offset) const {
if (pData_.empty()) {
return nullptr;
}
if (offset >= pData_.size()) {
if (offset > pData_.size()) {
throw std::out_of_range("Overflow in Exiv2::DataBuf::c_data");
}
return &pData_[offset];
Expand Down

0 comments on commit b2808bc

Please sign in to comment.