linux-stable/kernel/debug
Daniel Thompson d228bee820 kdb: Eliminate strncpy() warnings by replacing with strscpy()
Currently the code to manage the kdb history buffer uses strncpy() to
copy strings to/and from the history and exhibits the classic "but
nobody ever told me that strncpy() doesn't always terminate strings"
bug. Modern gcc compilers recognise this bug and issue a warning.

In reality these calls will only abridge the copied string if kdb_read()
has *already* overflowed the command buffer. Thus the use of counted
copies here is only used to reduce the secondary effects of a bug
elsewhere in the code.

Therefore transitioning these calls into strscpy() (without checking
the return code) is appropriate.

Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
2020-04-01 16:59:02 +01:00
..
kdb kdb: Eliminate strncpy() warnings by replacing with strscpy() 2020-04-01 16:59:02 +01:00
debug_core.c kdb: Avoid array subscript warnings on non-SMP builds 2019-10-24 15:34:58 +01:00
debug_core.h kdb: Fix stack crawling on 'running' CPUs that aren't the master 2019-10-10 16:28:48 +01:00
gdbstub.c gdbstub: Replace strcpy() by strscpy() 2019-05-02 13:40:27 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00