diff --git a/src/crypto/crypto_random.cc b/src/crypto/crypto_random.cc index 2652b7d8aae17a..953932ddd9a496 100644 --- a/src/crypto/crypto_random.cc +++ b/src/crypto/crypto_random.cc @@ -40,7 +40,6 @@ Maybe RandomBytesTraits::AdditionalConfig( const FunctionCallbackInfo& args, unsigned int offset, RandomBytesConfig* params) { - Environment* env = Environment::GetCurrent(args); CHECK(IsAnyByteSource(args[offset])); // Buffer to fill CHECK(args[offset + 1]->IsUint32()); // Offset CHECK(args[offset + 2]->IsUint32()); // Size @@ -52,11 +51,6 @@ Maybe RandomBytesTraits::AdditionalConfig( CHECK_GE(byte_offset + size, byte_offset); // Overflow check. CHECK_LE(byte_offset + size, in.size()); // Bounds check. - if (UNLIKELY(size > INT_MAX)) { - THROW_ERR_OUT_OF_RANGE(env, "buffer is too large"); - return Nothing(); - } - params->buffer = in.data() + byte_offset; params->size = size;