Fix coverity issues 15/321515/1
authorDariusz Michaluk <d.michaluk@samsung.com>
Mon, 24 Mar 2025 09:04:40 +0000 (10:04 +0100)
committerDariusz Michaluk <d.michaluk@samsung.com>
Mon, 24 Mar 2025 09:04:40 +0000 (10:04 +0100)
Change-Id: I267e2829404999a0515709d29a8a815c1e54e79a

haltest/security-certs.cpp

index ec951109ea55f0a433aefcb91143627b4d177170..a56f9a7f16b8d1995c04c102d63d4afd941d9010 100644 (file)
@@ -155,7 +155,7 @@ TEST_F(SECURITY_CERTS, SignCryptoDataPositive)
         ret = hal_security_certs_create_key_context(&context, key_type_data_s);
         EXPECT_EQ(ret, 0) << "Failed to create key context (" << ret << ")";
 
-        for (auto digest : digest_length_map) {
+        for (auto &digest : digest_length_map) {
             char data[digest.second] = {0,};
             hal_security_certs_data_s message_data_s =
             {
@@ -221,7 +221,7 @@ TEST_F(SECURITY_CERTS, GetKeyTypeAndLengthPositive)
         {"ECDSA", {HAL_SECURITY_CERTS_KEY_TYPE_ECDSA, 521}},
     };
 
-    for (auto key : key_map)
+    for (auto &key : key_map)
     {
         std::string key_type = key.first;
         hal_security_certs_crypto_key_type_e ret_key_type_enum;
@@ -263,7 +263,7 @@ TEST_F(SECURITY_CERTS, ExtCallApiNegative)
         method_name.size()
     };
 
-    hal_security_certs_data_s input_data_s;
+    hal_security_certs_data_s input_data_s = {NULL, 0};
     hal_security_certs_data_s output_data_s;
 
     ret = hal_security_certs_ext_call_api(method_name_data_s, input_data_s, &output_data_s);