Skip to content

Commit fe358f9

Browse files
committed
tls: refactor to avoid unsafe array iteration
1 parent 4811210 commit fe358f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/_tls_common.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,8 @@ exports.createSecureContext = function createSecureContext(options) {
217217
// which leads to the crash later on.
218218
if (key) {
219219
if (ArrayIsArray(key)) {
220-
for (const val of key) {
220+
for (let i = 0; i < key.length; ++i) {
221+
const val = key[i];
221222
// eslint-disable-next-line eqeqeq
222223
const pem = (val != undefined && val.pem !== undefined ? val.pem : val);
223224
setKey(c.context, pem, val.passphrase || passphrase);

0 commit comments

Comments
 (0)