Fix clipping of returned data size in secure_storage_provider

The secure_storage_provider logic in the get_handler was incorrect and
could result in the return data being incorrectly clipped in
length because of the use of an uninitialized variable. This commit
fixes the logic.

Signed-off-by: Julian Hall <julian.hall@arm.com>
Change-Id: Id7ab5596015c918311ba42064092f2369fa31cb2
diff --git a/components/service/secure_storage/frontend/secure_storage_provider/secure_storage_provider.c b/components/service/secure_storage/frontend/secure_storage_provider/secure_storage_provider.c
index 8703157..4401dc0 100644
--- a/components/service/secure_storage/frontend/secure_storage_provider/secure_storage_provider.c
+++ b/components/service/secure_storage/frontend/secure_storage_provider/secure_storage_provider.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
+ * Copyright (c) 2020-2022, Arm Limited and Contributors. All rights reserved.
  *
  * SPDX-License-Identifier: BSD-3-Clause
  */
@@ -55,7 +55,7 @@
 	request_desc = (struct secure_storage_request_get *)(req->req_buf.data);
 
 	/* Clip the requested data size if it's too big for the response buffer */
-	size_t data_size = (req->resp_buf.size < data_size) ?
+	size_t data_size = (req->resp_buf.size < request_desc->data_size) ?
 		req->resp_buf.size :
 		request_desc->data_size;