diff options
| author | Gustavo A. R. Silva <gustavo@embeddedor.com> | 2019-04-22 12:39:34 -0400 |
|---|---|---|
| committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2019-04-23 04:54:26 -0400 |
| commit | c7d5f21e8d184f255785e02760139037a97fd796 (patch) | |
| tree | 8dc935aedba3111a6eab4113dbeee21060cd2d22 | |
| parent | 603fadf33604a2e170eb833f99f569d3597f1f09 (diff) | |
ACPI: event: replace strcpy() by strscpy()
The strcpy() function is being deprecated. Replace it by the safer
strscpy() and fix the following Coverity warnings:
"You might overrun the 15-character fixed-size string event->bus_id
by copying bus_id without checking the length."
"You might overrun the 20-character fixed-size string event->device_class
by copying device_class without checking the length."
Addresses-Coverity-ID: 139001 ("Copy into fixed size buffer")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
| -rw-r--r-- | drivers/acpi/event.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/event.c b/drivers/acpi/event.c index 5a127f3f2d5c..47f21599f2ab 100644 --- a/drivers/acpi/event.c +++ b/drivers/acpi/event.c | |||
| @@ -131,8 +131,8 @@ int acpi_bus_generate_netlink_event(const char *device_class, | |||
| 131 | event = nla_data(attr); | 131 | event = nla_data(attr); |
| 132 | memset(event, 0, sizeof(struct acpi_genl_event)); | 132 | memset(event, 0, sizeof(struct acpi_genl_event)); |
| 133 | 133 | ||
| 134 | strcpy(event->device_class, device_class); | 134 | strscpy(event->device_class, device_class, sizeof(event->device_class)); |
| 135 | strcpy(event->bus_id, bus_id); | 135 | strscpy(event->bus_id, bus_id, sizeof(event->bus_id)); |
| 136 | event->type = type; | 136 | event->type = type; |
| 137 | event->data = data; | 137 | event->data = data; |
| 138 | 138 | ||
