mirror of
https://github.com/nodejs/node.git
synced 2026-11-25 23:01:06 -05:00
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: https://github.com/nodejs/node/pull/42257 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Mestery <mestery@protonmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
ba1d949ce0
commit
268fd97925
1 file changed
-4
@@ -642,10 +642,6 @@ MaybeLocal<Value> StringBytes::Encode(Isolate* isolate,
|
||||
switch (encoding) {
|
||||
case BUFFER:
|
||||
{
|
||||
if (buflen > node::Buffer::kMaxLength) {
|
||||
*error = node::ERR_BUFFER_TOO_LARGE(isolate);
|
||||
return MaybeLocal<Value>();
|
||||
}
|
||||
auto maybe_buf = Buffer::Copy(isolate, buf, buflen);
|
||||
Local<v8::Object> buf;
|
||||
if (!maybe_buf.ToLocal(&buf)) {
|
||||
|
||||
Reference in new issue
Block a user