From 2a59c832c184236de8c96e3eef298242da981585 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Fri, 8 Apr 2016 23:03:42 +0900 Subject: [PATCH] nghttpx: Set 0 to next_proto_len explicitly for clarification --- src/shrpx_client_handler.cc | 2 +- src/shrpx_http2_session.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shrpx_client_handler.cc b/src/shrpx_client_handler.cc index 6985e079..1ecfbbe7 100644 --- a/src/shrpx_client_handler.cc +++ b/src/shrpx_client_handler.cc @@ -519,7 +519,7 @@ void ClientHandler::signal_reset_upstream_conn_rtimer() { int ClientHandler::validate_next_proto() { const unsigned char *next_proto = nullptr; - unsigned int next_proto_len; + unsigned int next_proto_len = 0; // First set callback for catch all cases on_read_ = &ClientHandler::upstream_read; diff --git a/src/shrpx_http2_session.cc b/src/shrpx_http2_session.cc index 8527aa53..28bd34b2 100644 --- a/src/shrpx_http2_session.cc +++ b/src/shrpx_http2_session.cc @@ -1424,7 +1424,7 @@ int Http2Session::connection_made() { if (ssl_ctx_) { const unsigned char *next_proto = nullptr; - unsigned int next_proto_len; + unsigned int next_proto_len = 0; SSL_get0_next_proto_negotiated(conn_.tls.ssl, &next_proto, &next_proto_len); for (int i = 0; i < 2; ++i) { if (next_proto) {