mirror of
https://git.code.sf.net/p/linux-ima/ima-evm-utils
synced 2025-04-27 06:12:32 +02:00
Limit the file hash algorithm name length
Instead of assuming the file hash algorithm is a properly NULL terminated string, properly limit the "algo:<hash>" field size. Reviewed-by: Petr Vorel <pvorel@suse.cz> Reviewed-by: Stefan Berger <stefanb@linux.ibm.com> Signed-off-by: Mimi Zohar <zohar@linux.ibm.com>
This commit is contained in:
parent
f2b1b66b7c
commit
232836a079
@ -1603,7 +1603,7 @@ void ima_ng_show(struct template_entry *entry)
|
||||
total_len -= sizeof(field_len);
|
||||
|
||||
algo = (char *)fieldp;
|
||||
len = strlen(algo) + 1;
|
||||
len = strnlen(algo, field_len - 1) + 1;
|
||||
digest_len = field_len - len;
|
||||
digest = fieldp + len;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user