diff options
author | Armin Wolf <W_Armin@gmx.de> | 2023-01-19 15:21:14 +0100 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2023-01-30 16:43:25 +0100 |
commit | a1a32ded2887fd421d67e9c9b67ae4504bdb08c9 (patch) | |
tree | e0e87ed8a9e2e803221a2faf35433aaccf9390bb /include/linux/fpga/fpga-bridge.h | |
parent | f2ac14b5f197e4a2dec51e5ceaa56682ff1592bc (diff) |
ACPI: battery: Fix buffer overread if not NUL-terminated
If a buffer containing ASCII characters is not NUL-terminated
(which is perfectly legal according to the ACPI specification),
the ACPI battery driver might not honor its length.
Fix this by limiting the amount of data to be copied to
the buffer length while also using strscpy() to make sure
that the resulting string is always NUL-terminated.
Also replace strncpy() vs strscpy().
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'include/linux/fpga/fpga-bridge.h')
0 files changed, 0 insertions, 0 deletions