Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/c/coreboot/+/33375 )
Change subject: qualcomm: qclib: Ensure interface table entry name is terminated ......................................................................
qualcomm: qclib: Ensure interface table entry name is terminated
This string is printed in dump_te_table() so we should make sure it's properly null-terminated.
This fixes Coverity issue 1401305.
Change-Id: I45827f552c2d8a4e01b50a699ac88ee457043282 Signed-off-by: Julius Werner jwerner@chromium.org Reviewed-on: https://review.coreboot.org/c/coreboot/+/33375 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Paul Menzel paulepanter@users.sourceforge.net Reviewed-by: Patrick Georgi pgeorgi@google.com --- M src/soc/qualcomm/common/qclib.c 1 file changed, 1 insertion(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Patrick Georgi: Looks good to me, approved Paul Menzel: Looks good to me, but someone else must approve
diff --git a/src/soc/qualcomm/common/qclib.c b/src/soc/qualcomm/common/qclib.c index 73c5250..25512a9 100644 --- a/src/soc/qualcomm/common/qclib.c +++ b/src/soc/qualcomm/common/qclib.c @@ -41,7 +41,7 @@ struct qclib_cb_if_table_entry *te = &qclib_cb_if_table.te[qclib_cb_if_table.num_entries++]; assert(qclib_cb_if_table.num_entries <= qclib_cb_if_table.max_entries); - strncpy(te->name, name, sizeof(te->name)); + strncpy(te->name, name, sizeof(te->name) - 1); te->blob_address = (uintptr_t)base; te->size = size; te->blob_attributes = attrs;