From 86a5690e385284be77a7b3b75cf4515bf5faa893 Mon Sep 17 00:00:00 2001 From: Diana Holland Date: Fri, 12 Oct 2018 11:36:17 -0700 Subject: [PATCH] crypto: move field initialization to class MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/23610 Reviewed-By: James M Snell Reviewed-By: Anna Henningsen Reviewed-By: Refael Ackermann Reviewed-By: Colin Ihrig Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Gireesh Punathil Reviewed-By: Sakthipriyan Vairamani Reviewed-By: Ujjwal Sharma --- src/node_crypto_clienthello-inl.h | 9 +-------- src/node_crypto_clienthello.h | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/node_crypto_clienthello-inl.h b/src/node_crypto_clienthello-inl.h index c5c595c7606cf9..9de8f2e5fcf731 100644 --- a/src/node_crypto_clienthello-inl.h +++ b/src/node_crypto_clienthello-inl.h @@ -34,14 +34,7 @@ inline ClientHelloParser::ClientHelloParser() : state_(kEnded), onhello_cb_(nullptr), onend_cb_(nullptr), - cb_arg_(nullptr), - session_size_(0), - session_id_(nullptr), - servername_size_(0), - servername_(nullptr), - ocsp_request_(0), - tls_ticket_size_(0), - tls_ticket_(nullptr) { + cb_arg_(nullptr) { Reset(); } diff --git a/src/node_crypto_clienthello.h b/src/node_crypto_clienthello.h index fd8756254ffc24..687e9589b6d932 100644 --- a/src/node_crypto_clienthello.h +++ b/src/node_crypto_clienthello.h @@ -108,16 +108,16 @@ class ClientHelloParser { OnHelloCb onhello_cb_; OnEndCb onend_cb_; void* cb_arg_; - size_t frame_len_; - size_t body_offset_; - size_t extension_offset_; - uint8_t session_size_; - const uint8_t* session_id_; - uint16_t servername_size_; - const uint8_t* servername_; - uint8_t ocsp_request_; - uint16_t tls_ticket_size_; - const uint8_t* tls_ticket_; + size_t frame_len_ = 0; + size_t body_offset_ = 0; + size_t extension_offset_ = 0; + uint8_t session_size_ = 0; + const uint8_t* session_id_ = nullptr; + uint16_t servername_size_ = 0; + const uint8_t* servername_ = nullptr; + uint8_t ocsp_request_ = 0; + uint16_t tls_ticket_size_ = -1; + const uint8_t* tls_ticket_ = nullptr; }; } // namespace crypto