diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 0ebebec5d2437a..4e97c390848340 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -3887,7 +3887,7 @@ void PublicKeyCipher::Cipher(const FunctionCallbackInfo& args) { bool r = Cipher( kbuf, klen, - args.Length() >= 3 && !args[2]->IsNull() ? *passphrase : nullptr, + args.Length() >= 4 && !args[3]->IsNull() ? *passphrase : nullptr, padding, reinterpret_cast(buf), len,