1
0
mirror of https://git.code.sf.net/p/linux-ima/ima-evm-utils synced 2025-07-16 04:00:43 +02:00

Address "ignoring number of bytes read" messages

Coverity complains about the existing "if (!fread(....))" and inverse
syntax.  Change it to make Coverity happy.

Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
Mimi Zohar
2021-07-15 16:15:21 -04:00
parent ad1d5e3f67
commit 84a423d5a1
2 changed files with 3 additions and 3 deletions

View File

@ -156,7 +156,7 @@ static int add_file_hash(const char *file, EVP_MD_CTX *ctx)
for (size = stats.st_size; size; size -= len) {
len = MIN(size, bs);
if (!fread(data, len, 1, fp)) {
if (fread(data, len, 1, fp) != 1) {
if (ferror(fp)) {
log_err("fread() failed\n\n");
goto out;