Skip to content

Commit 5764966

Browse files
committed
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
1 parent 048e0e7 commit 5764966

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/node_crypto_clienthello.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ void ClientHelloParser::ParseExtension(ClientHelloParser::ExtensionType type,
140140
{
141141
if (len < 2)
142142
return;
143-
uint16_t server_names_len = (data[0] << 8) + data[1];
143+
uint32_t server_names_len = (data[0] << 8) + data[1];
144144
if (server_names_len + 2 > len)
145145
return;
146146
for (size_t offset = 2; offset < 2 + server_names_len; ) {

0 commit comments

Comments
 (0)