Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 377e8ce

Browse filesBrowse files
codebytereaduh95
authored andcommitted
tls: avoid external memory leak on invalid protocol versions
PR-URL: #60390 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent 4a5d7a4 commit 377e8ce
Copy full SHA for 377e8ce

File tree

Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-3
lines changed
Open diff view settings
Collapse file

‎lib/internal/tls/common.js‎

Copy file name to clipboardExpand all lines: lib/internal/tls/common.js
+4-3Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,11 @@ function SecureContext(secureProtocol, secureOptions, minVersion, maxVersion) {
8282
throw new ERR_TLS_PROTOCOL_VERSION_CONFLICT(maxVersion, secureProtocol);
8383
}
8484

85+
const minV = toV('minimum', minVersion, tls.DEFAULT_MIN_VERSION);
86+
const maxV = toV('maximum', maxVersion, tls.DEFAULT_MAX_VERSION);
87+
8588
this.context = new NativeSecureContext();
86-
this.context.init(secureProtocol,
87-
toV('minimum', minVersion, tls.DEFAULT_MIN_VERSION),
88-
toV('maximum', maxVersion, tls.DEFAULT_MAX_VERSION));
89+
this.context.init(secureProtocol, minV, maxV);
8990

9091
if (secureOptions) {
9192
validateInteger(secureOptions, 'secureOptions');

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.