mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-27 22:32:31 +02:00
ima-evm-utils: Fix reading of sigfile
Fix reading of detached IMA signature (--sigfile). Error message: Reading to sha1.txt.sig Failed to fread 147 bytes: sha1.txt.sig Failed reading: sha1.txt Reported-by: Mimi Zohar <zohar@linux.ibm.com> Fixes: 08a51e7460fd ("ima-evm-utils: Fix file2bin stat and fopen relations") Signed-off-by: Vitaly Chikunov <vt@altlinux.org> Reviewed-by: Lakshmi Ramasubramanian <nramas@linux.microsoft.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com> (cherry picked from commit 19b77c866738ca0718232348edf56259071db7cf)
This commit is contained in:
parent
97b912a727
commit
f27e2f7d99
@ -221,7 +221,7 @@ static unsigned char *file2bin(const char *file, const char *ext, int *size)
|
||||
fclose(fp);
|
||||
return NULL;
|
||||
}
|
||||
if (fread(data, len, 1, fp) != len) {
|
||||
if (fread(data, len, 1, fp) != 1) {
|
||||
log_err("Failed to fread %zu bytes: %s\n", len, name);
|
||||
fclose(fp);
|
||||
free(data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user