[PATCH 2/2] fwts_acpi_tables: memcpy 4 char ACPI table name

Colin King colin.king at canonical.com
Sat Jun 19 17:21:50 UTC 2021


From: Colin Ian King <colin.king at canonical.com>

Don't use strncpy, use memcpy of the raw 4 char table name.

Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
 src/lib/src/fwts_acpi_tables.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/lib/src/fwts_acpi_tables.c b/src/lib/src/fwts_acpi_tables.c
index 42285f99..b8b710bc 100644
--- a/src/lib/src/fwts_acpi_tables.c
+++ b/src/lib/src/fwts_acpi_tables.c
@@ -261,7 +261,7 @@ static void fwts_acpi_add_table(
 		if (strncmp(tables[i].name, name, 4) == 0)
 			which++;
 		if (tables[i].data == NULL) {
-			strncpy(tables[i].name, name, 4);
+			memcpy(tables[i].name, name, 4);
 			tables[i].name[4] = 0;
 			tables[i].data = table;
 			tables[i].addr = addr;
-- 
2.31.1




More information about the fwts-devel mailing list