summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/uttrack.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2018-01-04 22:41:27 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2018-01-05 01:33:22 +0100
commitee68d4773ed36e3f79860bbcad0a4ddd8d58f393 (patch)
tree5dd69e007decde8a5ca37b22a59f9b21a293333a /drivers/acpi/acpica/uttrack.c
parentACPICA: Cleanup the global variables and update comments (diff)
downloadlinux-ee68d4773ed36e3f79860bbcad0a4ddd8d58f393.tar.xz
linux-ee68d4773ed36e3f79860bbcad0a4ddd8d58f393.zip
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 <robert.moore@intel.com> Signed-off-by: Erik Schmauss <erik.schmauss@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/uttrack.c')
-rw-r--r--drivers/acpi/acpica/uttrack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/uttrack.c b/drivers/acpi/acpica/uttrack.c
index 28a302eb2015..633b4e2c669f 100644
--- a/drivers/acpi/acpica/uttrack.c
+++ b/drivers/acpi/acpica/uttrack.c
@@ -402,8 +402,8 @@ acpi_ut_track_allocation(struct acpi_debug_mem_block *allocation,
allocation->component = component;
allocation->line = line;
- strncpy(allocation->module, module, ACPI_MAX_MODULE_NAME);
- allocation->module[ACPI_MAX_MODULE_NAME - 1] = 0;
+ acpi_ut_safe_strncpy(allocation->module, (char *)module,
+ ACPI_MAX_MODULE_NAME);
if (!element) {