From b2808bcf275ea3a25b748e5688273c3402b3bb04 Mon Sep 17 00:00:00 2001 From: Kevin Backhouse Date: Sat, 17 Jun 2023 12:55:43 +0100 Subject: [PATCH] Allow c_data() to return zero byte buffer. --- src/types.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.cpp b/src/types.cpp index dea5c94b73..6559e20f4d 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -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];