Skip to content

Commit

Permalink
Appease -Werror=maybe-uninitialized
Browse files Browse the repository at this point in the history
test/bad_dtls_test.c: In function 'validate_client_hello':
test/bad_dtls_test.c:128:33: error: 'u' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if (!PACKET_get_1(&pkt, &u) || u != SSL3_RT_HANDSHAKE)
                                 ^
Apparently -O1 does not perform sufficient optimization to ascertain
that PACKET_get_1 will always initialize u if it returns true.

Reviewed-by: Rich Salz <[email protected]>
Reviewed-by: Richard Levitte <[email protected]>
(Merged from openssl#4518)
  • Loading branch information
kaduk committed Oct 11, 2017
1 parent f9df0a7 commit 165cc51
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion test/bad_dtls_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static int validate_client_hello(BIO *wbio)
long len;
unsigned char *data;
int cookie_found = 0;
unsigned int u;
unsigned int u = 0;

len = BIO_get_mem_data(wbio, (char **)&data);
if (!PACKET_buf_init(&pkt, data, len))
Expand Down

0 comments on commit 165cc51

Please sign in to comment.