From: Wonnam Jang Date: Thu, 12 Apr 2018 11:27:49 +0000 (+0900) Subject: Correct to check return of fread X-Git-Tag: submit/tizen/20180417.064953~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=16dab0bd55b7d4fe74ef58a0f62ba0264e14039b;p=platform%2Fcore%2Fuifw%2Fvoice-control.git Correct to check return of fread Change-Id: I2be0a615a5a5052f56c1c4958f9575033c952b38 Signed-off-by: Wonnam Jang --- diff --git a/client/vc.c b/client/vc.c index 9cfc04b..b3c9b24 100644 --- a/client/vc.c +++ b/client/vc.c @@ -110,7 +110,7 @@ static int __check_privilege(const char* uid, const char * privilege) fp = fopen(label_path, "r"); if (fp != NULL) { - if (strlen(smack_label) != fread(smack_label, 1, sizeof(smack_label), fp)) + if (0 >= fread(smack_label, 1, sizeof(smack_label), fp)) SLOG(LOG_ERROR, TAG_VCC, "[ERROR] fail to fread"); fclose(fp); diff --git a/common/vc_command.c b/common/vc_command.c index 77e363b..282f9a4 100644 --- a/common/vc_command.c +++ b/common/vc_command.c @@ -102,7 +102,7 @@ static int __check_privilege(const char* uid, const char * privilege) fp = fopen(label_path, "r"); if (fp != NULL) { - if (sizeof(smack_label) != fread(smack_label, 1, sizeof(smack_label), fp)) + if (0 >= fread(smack_label, 1, sizeof(smack_label), fp)) SLOG(LOG_ERROR, TAG_VCCMD, "[ERROR] fail to fread"); fclose(fp);