Skip to content
Open
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
7 changes: 5 additions & 2 deletions deps/ncrypto/ncrypto.cc
Original file line number Diff line number Diff line change
Expand Up @@ -483,9 +483,12 @@ Buffer<void> DataPointer::release() {
}

DataPointer DataPointer::resize(size_t len) {
size_t actual_len = std::min(len_, len);
const size_t actual_len = std::min(len_, len);
if (actual_len == len_) return std::move(*this);

auto buf = release();
if (actual_len == len_) return DataPointer(buf.data, actual_len);
if (actual_len == 0) return DataPointer(buf.data, actual_len);

buf.data = OPENSSL_realloc(buf.data, actual_len);
buf.len = actual_len;
return DataPointer(buf);
Expand Down
Loading