diff --git a/file_ops.c b/file_ops.c index e477f3d044..55d2a18cdc 100644 --- a/file_ops.c +++ b/file_ops.c @@ -110,6 +110,8 @@ static bool read_generic_file(const char *path, void **buf, ssize_t *len) fseek(file, 0, SEEK_END); _len = ftell(file); + if (_len < 0) + goto error; rewind(file);