From 576496632c96628eb47e8650987edf01d765a6ab Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 6 Aug 2013 15:36:12 +0200 Subject: [PATCH] crypto: fix signed/unsigned comparison warning The type of the expression `(uint16_t) server_names_len + 2` gets implicitly widened to int. Change the type of server_names_len to uint32_t to avoid the following warnings: ../../src/node_crypto_clienthello.cc:144: warning: comparison between signed and unsigned integer expressions ../../src/node_crypto_clienthello.cc:146: warning: comparison between signed and unsigned integer expressions --- src/node_crypto_clienthello.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/node_crypto_clienthello.cc b/src/node_crypto_clienthello.cc index 424b30e5b9..b786942529 100644 --- a/src/node_crypto_clienthello.cc +++ b/src/node_crypto_clienthello.cc @@ -140,7 +140,7 @@ void ClientHelloParser::ParseExtension(ClientHelloParser::ExtensionType type, { if (len < 2) return; - uint16_t server_names_len = (data[0] << 8) + data[1]; + uint32_t server_names_len = (data[0] << 8) + data[1]; if (server_names_len + 2 > len) return; for (size_t offset = 2; offset < 2 + server_names_len; ) {