Initialize output buffer length to 0
Signed-off-by: gabor-mezei-arm <gabor.mezei@arm.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index f81e18c..894e3cb 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -3493,6 +3493,8 @@
psa_key_type_t key_type;
size_t iv_length;
+ *output_length = 0;
+
if( ! PSA_ALG_IS_CIPHER( alg ) )
return( PSA_ERROR_INVALID_ARGUMENT );
@@ -3545,6 +3547,8 @@
psa_status_t unlock_status = PSA_ERROR_CORRUPTION_DETECTED;
psa_key_slot_t *slot;
+ *output_length = 0;
+
if( ! PSA_ALG_IS_CIPHER( alg ) )
return( PSA_ERROR_INVALID_ARGUMENT );