From a4141a09f28a092f8bcd30fded8a602cba009be0 Mon Sep 17 00:00:00 2001 From: Dongsun Lee Date: Mon, 1 Oct 2018 13:15:00 +0900 Subject: Fix SVACE - WGID=246303 : UNCHECKED_FUNC_RES.LIB.STRICT Change-Id: Ieaf575a65ec650949853ffd634500f480a64b588 Signed-off-by: Dongsun Lee --- srcs/key_handler.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'srcs') diff --git a/srcs/key_handler.c b/srcs/key_handler.c index c5a2f95..b992799 100644 --- a/srcs/key_handler.c +++ b/srcs/key_handler.c @@ -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) { -- cgit v1.2.3