diff options
author | Julius Werner <jwerner@chromium.org> | 2019-06-10 13:18:59 -0700 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2019-06-28 06:25:43 +0000 |
commit | 096fd0a64b03fa3ecbdf14e3f27434a4d79ae26c (patch) | |
tree | c1a149bf2bf45c734363fe89592d8eafeeb44524 | |
parent | 5399f8084845225d666c1fcddc8b1f2d775b59eb (diff) | |
download | coreboot-096fd0a64b03fa3ecbdf14e3f27434a4d79ae26c.tar.xz |
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>
-rw-r--r-- | src/soc/qualcomm/common/qclib.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |