Fix bug about checking privilege 23/82423/1
authorKwangyoun Kim <ky85.kim@samsung.com>
Wed, 3 Aug 2016 08:34:53 +0000 (17:34 +0900)
committerKwangyoun Kim <ky85.kim@samsung.com>
Wed, 3 Aug 2016 08:35:20 +0000 (17:35 +0900)
Change-Id: Ie8c44e7a494ef1f5d928437ab61fbf8ddce32c0d
Signed-off-by: Kwangyoun Kim <ky85.kim@samsung.com>
client/stt.c [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 34e95cf..daf4ce3
@@ -92,13 +92,14 @@ static int __check_privilege_initialize()
 static int __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)
                SLOG(LOG_ERROR, TAG_STTC, "[ERROR] fail to fread");