From a8f2a1a9f624a716bc5068b1dcad0ff6aa2f3b38 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 13 Mar 2018 16:08:26 +0900 Subject: [PATCH] Fix issue detected by static analysis tool Change-Id: I23dd4ae66489799b1eaf5031fafff4cc1559fecd Signed-off-by: sungwook79.park --- src/privilege_checker.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/privilege_checker.cpp b/src/privilege_checker.cpp index d0ea719..da7ae6c 100644 --- a/src/privilege_checker.cpp +++ b/src/privilege_checker.cpp @@ -45,7 +45,7 @@ check_privilege(const char *uid, const char *privilege) { FILE *fp = NULL; char label_path[1024] = "/proc/self/attr/current"; - char smack_label[1024] = {'\0', }; + char smack_label[1024] = {0}; if (!p_cynara) { return false; @@ -53,7 +53,9 @@ check_privilege(const char *uid, const char *privilege) fp = fopen(label_path, "r"); if (fp != NULL) { - if (fread(smack_label, 1, sizeof(smack_label), fp) <= 0); + if (fread(smack_label, 1, sizeof(smack_label), fp) <= 0) { + LOGD("[check_privilege] fail to fread"); + } fclose(fp); } -- 2.34.1