Skip to content

Commit da79166

Browse files
authoredMar 10, 2022
src: remove redundant buffer size check
This condition is already checked by the CHECK_BUFLEN_IN_RANGE macro, so if it was true here, that would contradict the previous check. PR-URL: nodejs#42257 Reviewed-By: Rich Trott <[email protected]> Reviewed-By: Mestery <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent 29c0522 commit da79166

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed
 

‎src/string_bytes.cc

-4
Original file line numberDiff line numberDiff line change
@@ -642,10 +642,6 @@ MaybeLocal<Value> StringBytes::Encode(Isolate* isolate,
642642
switch (encoding) {
643643
case BUFFER:
644644
{
645-
if (buflen > node::Buffer::kMaxLength) {
646-
*error = node::ERR_BUFFER_TOO_LARGE(isolate);
647-
return MaybeLocal<Value>();
648-
}
649645
auto maybe_buf = Buffer::Copy(isolate, buf, buflen);
650646
Local<v8::Object> buf;
651647
if (!maybe_buf.ToLocal(&buf)) {

0 commit comments

Comments
 (0)
Please sign in to comment.