1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-10 05:03:02 +03:00

Exporter tests: Fix possible uninitialized variable use

Signed-off-by: Max Fillinger <max@max-fillinger.net>
This commit is contained in:
Max Fillinger
2024-10-30 18:58:50 +01:00
committed by Max Fillinger
parent 538ed71ecb
commit 81b41d40dc

View File

@@ -5898,8 +5898,6 @@ exit:
void ssl_tls_exporter_rejects_bad_parameters(
int proto, int exported_key_length, int label_length, int context_length)
{
MD_OR_USE_PSA_INIT();
int ret = -1;
uint8_t *key_buffer = NULL;
char *label = NULL;
@@ -5914,9 +5912,7 @@ void ssl_tls_exporter_rejects_bad_parameters(
TEST_CALLOC(label, label_length);
TEST_CALLOC(context, context_length);
memset(key_buffer, 0, exported_key_length);
memset(label, 0, label_length);
memset(context, 0, context_length);
MD_OR_USE_PSA_INIT();
ret = mbedtls_test_ssl_do_handshake_with_endpoints(&server_ep, &client_ep, &options, proto);
TEST_ASSERT(ret == 0);