From 096fd0a64b03fa3ecbdf14e3f27434a4d79ae26c Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Mon, 10 Jun 2019 13:18:59 -0700 Subject: [PATCH] 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/33375 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel Reviewed-by: Patrick Georgi --- src/soc/qualcomm/common/qclib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/soc/qualcomm/common/qclib.c b/src/soc/qualcomm/common/qclib.c index 73c525001e..25512a938f 100644 --- a/src/soc/qualcomm/common/qclib.c +++ b/src/soc/qualcomm/common/qclib.c @@ -41,7 +41,7 @@ void qclib_add_if_table_entry(const char *name, void *base, 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;