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 95528b2

Browse filesBrowse files
RaisinTenBethGriggs
authored andcommitted
src: remove unnecessary comment and add a CHECK in crypto_tls.cc
Signed-off-by: Darshan Sen <darshan.sen@postman.com> PR-URL: #39991 Reviewed-By: Anna Henningsen <anna@addaleax.net>
1 parent 8d5787a commit 95528b2
Copy full SHA for 95528b2

File tree

Expand file treeCollapse file tree

1 file changed

+1
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-8
lines changed
Open diff view settings
Collapse file

‎src/crypto/crypto_tls.cc‎

Copy file name to clipboardExpand all lines: src/crypto/crypto_tls.cc
+1-8Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,26 +144,19 @@ int NewSessionCallback(SSL* s, SSL_SESSION* sess) {
144144
return 0;
145145

146146
// Serialize session
147-
// TODO(@jasnell): An AllocatedBuffer or BackingStore would be better
148-
// here to start eliminating unnecessary uses of Buffer where an ordinary
149-
// Uint8Array would do just fine.
150147
Local<Object> session = Buffer::New(env, size).FromMaybe(Local<Object>());
151148
if (UNLIKELY(session.IsEmpty()))
152149
return 0;
153150

154151
unsigned char* session_data =
155152
reinterpret_cast<unsigned char*>(Buffer::Data(session));
156153

157-
memset(session_data, 0, size);
158-
i2d_SSL_SESSION(sess, &session_data);
154+
CHECK_EQ(i2d_SSL_SESSION(sess, &session_data), size);
159155

160156
unsigned int session_id_length;
161157
const unsigned char* session_id_data =
162158
SSL_SESSION_get_id(sess, &session_id_length);
163159

164-
// TODO(@jasnell): An AllocatedBuffer or BackingStore would be better
165-
// here to start eliminating unnecessary uses of Buffer where an ordinary
166-
// Uint8Array would do just fine
167160
Local<Object> session_id = Buffer::Copy(
168161
env,
169162
reinterpret_cast<const char*>(session_id_data),

0 commit comments

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