Add NULL at the end of array.
authorBartlomiej Grzelewski <b.grzelewski@samsung.com>
Tue, 21 Jan 2014 15:02:09 +0000 (16:02 +0100)
committerMarcin Niesluchowski <m.niesluchow@samsung.com>
Thu, 23 Jan 2014 14:27:55 +0000 (15:27 +0100)
[Issue#]    N/A
[Bug]       Lack of NULL at the end of array may cause segmentation
            fault.
[Cause]     N/A
[Solution]  N/A

[Verification] Build, run tests.

Change-Id: Ie834aab741807bbe8b9974b82adea5fca0ce767a

tests/libprivilege-control-tests/test_cases.cpp

index f738e7726f9cedba35a5218f8035e3f259801602..8526c5bc8c9e52abac922cf06f77ffdb0633d7b8 100644 (file)
@@ -586,7 +586,7 @@ RUNNER_TEST(privilege_control11_add_api_feature)
     result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE[4].c_str(), test5, NULL, 0);
     RUNNER_ASSERT_MSG_BT(result == PC_ERR_INVALID_PARAM, "perm_add_api_feature returned: " << result);
 
-    const char *test6[] = { "-malformed malformed rwxat" };
+    const char *test6[] = { "-malformed malformed rwxat", NULL };
     result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE[5].c_str(), test6, NULL, 0);
     RUNNER_ASSERT_MSG_BT(result == PC_ERR_INVALID_PARAM, "perm_add_api_feature returned: " << result);
 
@@ -614,7 +614,7 @@ RUNNER_TEST(privilege_control11_add_api_feature)
     result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE[9].c_str(), test10, NULL, 0);
     RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS, "perm_add_api_feature returned: " << result);
 
-    const char *test11[] = { "Sub::sjE,ct ~APP~ a-RwXL", NULL}; // TODO This fails.
+    const char *test11[] = { "Sub::sjE,ct ~APP~ a-RwXL", NULL }; // TODO This fails.
     result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE[10].c_str(), test11, NULL, 0);
     RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS, "perm_add_api_feature returned: " << result);
 
@@ -630,7 +630,7 @@ RUNNER_TEST(privilege_control11_add_api_feature)
     RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS, "perm_add_api_feature returned: " << result);
 
     // empty group ids
-    const char *test13[] = { "~APP~ b a",NULL };
+    const char *test13[] = { "~APP~ b a", NULL};
     result = perm_add_api_feature(APP_TYPE_OSP, BLAHBLAH_FEATURE[12].c_str(), test13,(const gid_t[]) {0,1,2},0);
     RUNNER_ASSERT_MSG_BT(result == PC_OPERATION_SUCCESS, "perm_add_api_feature returned: " << result);
     result = file_exists(OSP_BLAHBLAH_DAC[12].c_str());