Fix SVACE 20/190320/3
authorDongsun Lee <ds73.lee@samsung.com>
Mon, 1 Oct 2018 04:15:00 +0000 (13:15 +0900)
committerDongsun Lee <ds73.lee@samsung.com>
Mon, 1 Oct 2018 04:33:39 +0000 (13:33 +0900)
- WGID=246303 : UNCHECKED_FUNC_RES.LIB.STRICT

Change-Id: Ieaf575a65ec650949853ffd634500f480a64b588
Signed-off-by: Dongsun Lee <ds73.lee@samsung.com>
srcs/key_handler.c

index c5a2f95..b992799 100644 (file)
@@ -157,7 +157,11 @@ static int _read_from_file(const char *path, raw_buffer_s **pdata)
                return WAE_ERROR_FILE;
        }
 
-       fseek(f, 0, SEEK_END); // move to the end of a file
+       if (fseek(f, 0, SEEK_END) != 0) { // move to the end of a file
+               WAE_SLOGE("Failed in fseek. file=%s", path);
+               ret = WAE_ERROR_FILE;
+               goto error;
+       }
        int file_len = ftell(f);
 
        if (file_len <= 0) {
@@ -166,7 +170,11 @@ static int _read_from_file(const char *path, raw_buffer_s **pdata)
                goto error;
        }
 
-       fseek(f, 0, SEEK_SET); // move to the start of a file
+       if (fseek(f, 0, SEEK_SET) != 0) { // move to the start of a file
+               WAE_SLOGE("Failed in fseek. file=%s", path);
+               ret = WAE_ERROR_FILE;
+               goto error;
+       }
 
        data = buffer_create(file_len);
        if (data == NULL) {