Hannah Williams has uploaded this change for review. ( https://review.coreboot.org/20867
Change subject: soc/intel/apollolake: Fix Coverity Error ......................................................................
soc/intel/apollolake: Fix Coverity Error
Change-Id: Ib7e43b195357c723e1ae51f609a8b07ad984380a Signed-off-by: Hannah Williams hannah.williams@intel.com --- M src/soc/intel/apollolake/cse.c 1 file changed, 4 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/67/20867/1
diff --git a/src/soc/intel/apollolake/cse.c b/src/soc/intel/apollolake/cse.c index 515d32b..3e1792c 100644 --- a/src/soc/intel/apollolake/cse.c +++ b/src/soc/intel/apollolake/cse.c @@ -92,6 +92,10 @@ 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;