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) {
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) {