From patchwork Sat Jun 19 17:21:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Ian King X-Patchwork-Id: 1494640 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.ubuntu.com (client-ip=91.189.94.19; helo=huckleberry.canonical.com; envelope-from=fwts-devel-bounces@lists.ubuntu.com; receiver=) Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4G6jJl61FKz9sW6 for ; Sun, 20 Jun 2021 03:21:58 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.86_2) (envelope-from ) id 1luefK-0002w1-Cy; Sat, 19 Jun 2021 17:21:54 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by huckleberry.canonical.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1luefH-0002vM-Q3 for fwts-devel@lists.ubuntu.com; Sat, 19 Jun 2021 17:21:51 +0000 Received: from 1.general.cking.uk.vpn ([10.172.193.212] helo=localhost) by youngberry.canonical.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1luefH-0002ec-Hg; Sat, 19 Jun 2021 17:21:51 +0000 From: Colin King To: fwts-devel@lists.ubuntu.com Subject: [PATCH 2/2] fwts_acpi_tables: memcpy 4 char ACPI table name Date: Sat, 19 Jun 2021 18:21:50 +0100 Message-Id: <20210619172150.1294172-3-colin.king@canonical.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210619172150.1294172-1-colin.king@canonical.com> References: <20210619172150.1294172-1-colin.king@canonical.com> MIME-Version: 1.0 X-BeenThere: fwts-devel@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Firmware Test Suite Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: fwts-devel-bounces@lists.ubuntu.com Sender: "fwts-devel" From: Colin Ian King Don't use strncpy, use memcpy of the raw 4 char table name. Signed-off-by: Colin Ian King Acked-by: Alex Hung Acked-by: Ivan Hu --- 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;