Skip to content

Commit 877b70b

Browse files
panvanpaun
authored andcommitted
crypto: fix output of privateDecrypt with zero-length data
closes #57553 closes #57572 closes #57558 PR-URL: nodejs/node#57575 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Yagiz Nizipli <[email protected]> Reviewed-By: Tobias Nießen <[email protected]> Reviewed-By: Darshan Sen <[email protected]>
1 parent 9ada536 commit 877b70b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ncrypto.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ Buffer<void> DataPointer::release() {
215215
DataPointer DataPointer::resize(size_t len) {
216216
size_t actual_len = std::min(len_, len);
217217
auto buf = release();
218-
if (actual_len == len_) return DataPointer(buf);
218+
if (actual_len == len_) return DataPointer(buf.data, actual_len);
219219
buf.data = OPENSSL_realloc(buf.data, actual_len);
220220
buf.len = actual_len;
221221
return DataPointer(buf);

0 commit comments

Comments
 (0)