diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 43495e247e..167ce2d173 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -8504,9 +8504,7 @@ psa_status_t psa_crypto_input_copy_alloc(const uint8_t *input, size_t input_len, input_copy->buffer = NULL; input_copy->len = 0; - /* Treat NULL and zero-length input the same. - * This is simpler than potentially calling calloc(0). */ - if (input == NULL || input_len == 0) { + if (input_len == 0) { return PSA_SUCCESS; } @@ -8549,9 +8547,7 @@ psa_status_t psa_crypto_output_copy_alloc(uint8_t *output, size_t output_len, output_copy->buffer = NULL; output_copy->len = 0; - /* Treat NULL and zero-length input the same. - * This is simpler than potentially calling calloc(0). */ - if (output == NULL || output_len == 0) { + if (output_len == 0) { return PSA_SUCCESS; } output_copy->buffer = mbedtls_calloc(output_len, 1);