mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2026-05-09 03:04:24 +02:00
Convert interruptible test over to using TEST_CALLOC
Also fix potential leak in unlikely edge case. Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
@@ -7639,8 +7639,7 @@ void interruptible_signverify_hash_edgecase_tests(int key_type_arg,
|
||||
* no reliance on external buffers. */
|
||||
psa_interruptible_set_max_ops(PSA_INTERRUPTIBLE_MAX_OPS_UNLIMITED);
|
||||
|
||||
input_buffer = mbedtls_calloc(1, input_data->len);
|
||||
TEST_ASSERT(input_buffer != NULL);
|
||||
TEST_CALLOC(input_buffer, input_data->len);
|
||||
|
||||
memcpy(input_buffer, input_data->x, input_data->len);
|
||||
|
||||
@@ -7657,8 +7656,7 @@ void interruptible_signverify_hash_edgecase_tests(int key_type_arg,
|
||||
|
||||
PSA_ASSERT(psa_sign_hash_abort(&sign_operation));
|
||||
|
||||
input_buffer = mbedtls_calloc(1, input_data->len);
|
||||
TEST_ASSERT(input_buffer != NULL);
|
||||
TEST_CALLOC(input_buffer, input_data->len);
|
||||
|
||||
memcpy(input_buffer, input_data->x, input_data->len);
|
||||
|
||||
@@ -7683,6 +7681,7 @@ exit:
|
||||
|
||||
psa_destroy_key(key);
|
||||
mbedtls_free(signature);
|
||||
mbedtls_free(input_buffer);
|
||||
PSA_DONE();
|
||||
}
|
||||
/* END_CASE */
|
||||
|
||||
Reference in New Issue
Block a user