Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@tnie.de>2022-03-11 02:48:01 +0300
committerGitHub <noreply@github.com>2022-03-11 02:48:01 +0300
commitda7916676bbb4dc912aee1e98513c63465ad7a73 (patch)
tree437e059275f6cea3372524d4380d501d09f915d2 /src/string_bytes.cc
parent29c05226168bc8a2462dac98679016bfe7006ea1 (diff)
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>
Diffstat (limited to 'src/string_bytes.cc')
-rw-r--r--src/string_bytes.cc4
1 files changed, 0 insertions, 4 deletions
diff --git a/src/string_bytes.cc b/src/string_bytes.cc
index daff1424d22..5b530c85477 100644
--- a/src/string_bytes.cc
+++ b/src/string_bytes.cc
@@ -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)) {