Skip to content

Commit

Permalink
Merge pull request Mbed-TLS#4462 from netfoundry/gcc11.fixes
Browse files Browse the repository at this point in the history
build with gcc11
  • Loading branch information
gilles-peskine-arm authored May 20, 2021
2 parents f4c1d58 + 03092f5 commit 3248be4
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion library/ecdsa.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,7 +651,7 @@ static int ecdsa_signature_to_asn1( const mbedtls_mpi *r, const mbedtls_mpi *s,
unsigned char *sig, size_t *slen )
{
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
unsigned char buf[MBEDTLS_ECDSA_MAX_LEN];
unsigned char buf[MBEDTLS_ECDSA_MAX_LEN] = {0};
unsigned char *p = buf + sizeof( buf );
size_t len = 0;

Expand Down
4 changes: 2 additions & 2 deletions library/x509write_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ int mbedtls_x509write_crt_set_authority_key_identifier( mbedtls_x509write_cert *
int mbedtls_x509write_crt_set_key_usage( mbedtls_x509write_cert *ctx,
unsigned int key_usage )
{
unsigned char buf[5], ku[2];
unsigned char buf[5] = {0}, ku[2] = {0};
unsigned char *c;
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
const unsigned int allowed_bits = MBEDTLS_X509_KU_DIGITAL_SIGNATURE |
Expand Down Expand Up @@ -272,7 +272,7 @@ int mbedtls_x509write_crt_set_key_usage( mbedtls_x509write_cert *ctx,
int mbedtls_x509write_crt_set_ns_cert_type( mbedtls_x509write_cert *ctx,
unsigned char ns_cert_type )
{
unsigned char buf[4];
unsigned char buf[4] = {0};
unsigned char *c;
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;

Expand Down
4 changes: 2 additions & 2 deletions library/x509write_csr.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ int mbedtls_x509write_csr_set_extension( mbedtls_x509write_csr *ctx,

int mbedtls_x509write_csr_set_key_usage( mbedtls_x509write_csr *ctx, unsigned char key_usage )
{
unsigned char buf[4];
unsigned char buf[4] = {0};
unsigned char *c;
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;

Expand All @@ -113,7 +113,7 @@ int mbedtls_x509write_csr_set_key_usage( mbedtls_x509write_csr *ctx, unsigned ch
int mbedtls_x509write_csr_set_ns_cert_type( mbedtls_x509write_csr *ctx,
unsigned char ns_cert_type )
{
unsigned char buf[4];
unsigned char buf[4] = {0};
unsigned char *c;
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;

Expand Down
4 changes: 2 additions & 2 deletions programs/test/udp_proxy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1005,8 +1005,8 @@ int main( int argc, char *argv[] )

for( delay_idx = 0; delay_idx < MAX_DELAYED_HS; delay_idx++ )
{
mbedtls_free( opt.delay_cli + delay_idx );
mbedtls_free( opt.delay_srv + delay_idx );
mbedtls_free( opt.delay_cli[delay_idx] );
mbedtls_free( opt.delay_srv[delay_idx] );
}

mbedtls_net_free( &client_fd );
Expand Down
2 changes: 1 addition & 1 deletion tests/suites/test_suite_ssl.function
Original file line number Diff line number Diff line change
Expand Up @@ -2649,7 +2649,7 @@ exit:
void ssl_message_mock_uninitialized( )
{
enum { MSGLEN = 10 };
unsigned char message[MSGLEN], received[MSGLEN];
unsigned char message[MSGLEN] = {0}, received[MSGLEN];
mbedtls_mock_socket client, server;
mbedtls_test_message_queue server_queue, client_queue;
mbedtls_test_message_socket_context server_context, client_context;
Expand Down

0 comments on commit 3248be4

Please sign in to comment.