From ee68d4773ed36e3f79860bbcad0a4ddd8d58f393 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Thu, 4 Jan 2018 13:41:27 -0800 Subject: ACPICA: Create and deploy safe version of strncpy ACPICA commit 64ad9c69a1bd534a466e060a33c0bbf5fc9e189c acpi_ut_safe_strncpy - copy and terminate string. Strncpy is not guaranteed to terminate the copied string if the input is longer than the length of the target. No functional change. Link: https://github.com/acpica/acpica/commit/64ad9c69 Signed-off-by: Bob Moore Signed-off-by: Erik Schmauss Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/psutils.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/acpi/acpica/psutils.c') diff --git a/drivers/acpi/acpica/psutils.c b/drivers/acpi/acpica/psutils.c index e15b636b1d4b..8bd7d01039cc 100644 --- a/drivers/acpi/acpica/psutils.c +++ b/drivers/acpi/acpica/psutils.c @@ -94,9 +94,11 @@ void acpi_ps_init_op(union acpi_parse_object *op, u16 opcode) op->common.descriptor_type = ACPI_DESC_TYPE_PARSER; op->common.aml_opcode = opcode; - ACPI_DISASM_ONLY_MEMBERS(strncpy(op->common.aml_op_name, - (acpi_ps_get_opcode_info(opcode))-> - name, sizeof(op->common.aml_op_name))); + ACPI_DISASM_ONLY_MEMBERS(acpi_ut_safe_strncpy(op->common.aml_op_name, + (acpi_ps_get_opcode_info + (opcode))->name, + sizeof(op->common. + aml_op_name))); } /******************************************************************************* -- cgit v1.2.1