We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8e1b6e7 commit 4253e55Copy full SHA for 4253e55
src/node_crypto.cc
@@ -4850,10 +4850,11 @@ void GetSSLCiphers(const FunctionCallbackInfo<Value>& args) {
4850
SSLPointer ssl(SSL_new(ctx.get()));
4851
CHECK(ssl);
4852
4853
- Local<Array> arr = Array::New(env->isolate());
4854
STACK_OF(SSL_CIPHER)* ciphers = SSL_get_ciphers(ssl.get());
+ int n = sk_SSL_CIPHER_num(ciphers);
4855
+ Local<Array> arr = Array::New(env->isolate(), n);
4856
- for (int i = 0; i < sk_SSL_CIPHER_num(ciphers); ++i) {
4857
+ for (int i = 0; i < n; ++i) {
4858
const SSL_CIPHER* cipher = sk_SSL_CIPHER_value(ciphers, i);
4859
arr->Set(env->context(),
4860
i,
0 commit comments