Correct to check return of fread 09/175809/1
authorWonnam Jang <wn.jang@samsung.com>
Thu, 12 Apr 2018 11:23:34 +0000 (20:23 +0900)
committerWonnam Jang <wn.jang@samsung.com>
Thu, 12 Apr 2018 11:23:34 +0000 (20:23 +0900)
Change-Id: I59e5b05bc4e6586b086112e919cd335a8feca2fd
Signed-off-by: Wonnam Jang <wn.jang@samsung.com>
client/stt.c

index 32b2534..8a55d34 100644 (file)
@@ -105,7 +105,7 @@ static bool __check_privilege(const char* uid, const char * privilege)
 
        fp = fopen(label_path, "r");
        if (fp != NULL) {
 
        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_STTC, "[ERROR] fail to fread");
 
                fclose(fp);
                        SLOG(LOG_ERROR, TAG_STTC, "[ERROR] fail to fread");
 
                fclose(fp);