Fix to check privilege issue 37/82437/1
authorsungwook79.park <sungwook79.park@samsung.com>
Wed, 3 Aug 2016 10:06:50 +0000 (19:06 +0900)
committersungwook79.park <sungwook79.park@samsung.com>
Wed, 3 Aug 2016 10:06:50 +0000 (19:06 +0900)
Change-Id: I87f8ff2bc6e5cbbe395d8fc6666329cbf580221f
Signed-off-by: sungwook79.park <sungwook79.park@samsung.com>
src/privilege_checker.cpp

index ffd6d26..e1ff8b8 100644 (file)
@@ -45,13 +45,14 @@ bool
 check_privilege(const char *uid, const char *privilege)
 {
     FILE *fp = NULL;
-    char smack_label[1024] = "/proc/self/attr/current";
+    char label_path[1024] = "/proc/self/attr/current";
+    char smack_label[1024] = {'\0',};
 
     if (!p_cynara) {
         return false;
     }
 
-    fp = fopen(smack_label, "r");
+    fp = fopen(label_path, "r");
     if (fp != NULL) {
         if (fread(smack_label, 1, sizeof(smack_label), fp) <= 0)
             LOGW("Error : fread");