From a9f7605b6bbfd935b4e5c9cb96bd74dd2483c0c7 Mon Sep 17 00:00:00 2001 From: Kwangyoun Kim Date: Wed, 3 Aug 2016 17:34:53 +0900 Subject: [PATCH] Fix bug about checking privilege Change-Id: Ie8c44e7a494ef1f5d928437ab61fbf8ddce32c0d Signed-off-by: Kwangyoun Kim --- client/stt.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100755 => 100644 client/stt.c diff --git a/client/stt.c b/client/stt.c old mode 100755 new mode 100644 index 34e95cf..daf4ce3 --- a/client/stt.c +++ b/client/stt.c @@ -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"); -- 2.7.4