From 3ceb5cb223ba03df13fb226c5cb07e3d2b71b3c6 Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Fri, 21 Dec 2018 19:14:01 +0100 Subject: [PATCH] Fix another Coverity Scan issue that really should not happen in practice. --- shared/read_file.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shared/read_file.cpp b/shared/read_file.cpp index 2310303..4084654 100644 --- a/shared/read_file.cpp +++ b/shared/read_file.cpp @@ -27,6 +27,10 @@ string read_file(const string &filename, const unsigned char *start, const size_ } int disk_size = ftell(fp); + if (disk_size == -1) { + perror("ftell"); + exit(1); + } ret = fseek(fp, 0, SEEK_SET); if (ret == -1) { -- 2.39.2