soc/intel/apollolake: Add file path check
Fixes Coverity Issue: 1372243 Change-Id: Ib7e43b195357c723e1ae51f609a8b07ad984380a Signed-off-by: Hannah Williams <hannah.williams@intel.com> Reviewed-on: https://review.coreboot.org/20867 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
parent
d0df1d7c4e
commit
58810c7af5
|
@ -92,6 +92,10 @@ static int read_cse_file(const char *path, void *buff, size_t *size,
|
|||
return 0;
|
||||
}
|
||||
|
||||
if (strnlen(path, sizeof(msg.file_name)) >= sizeof(msg.file_name)) {
|
||||
printk(BIOS_ERR, "path too big for msg.file_name buffer\n");
|
||||
return 0;
|
||||
}
|
||||
strncpy(msg.file_name, path, sizeof(msg.file_name));
|
||||
msg.mkhi_hdr.fields.group_id = MKHI_GROUP_ID_MCA;
|
||||
msg.mkhi_hdr.fields.command = READ_FILE;
|
||||
|
|
Loading…
Reference in New Issue