CKM: Additional assert for smack_new_label_from_self 34/40234/9
authorKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 1 Jun 2015 09:04:05 +0000 (11:04 +0200)
committerKrzysztof Jackiewicz <k.jackiewicz@samsung.com>
Mon, 15 Jun 2015 10:25:47 +0000 (12:25 +0200)
[Problem] Label was not checked against NULL
[Solution] Check added

[Verification] Succesfull compilation + tests

Change-Id: I19cbc6b8f7dfe3dc094b9398215aa370c50ae327

src/ckm/ckm-common.cpp

index e5d993c..87c3c88 100644 (file)
@@ -56,7 +56,7 @@ CharPtr get_label()
     char* my_label = NULL;
     RUNNER_ASSERT_MSG(0 <= (ret = smack_new_label_from_self(&my_label)),
                          "Failed to get smack label for self. Error: " << ret);
-
+    RUNNER_ASSERT_MSG(my_label, "NULL smack label");
     return CharPtr(my_label, free);
 }