aboutsummaryrefslogtreecommitdiff
path: root/scripts/gcc-plugins/cyc_complexity_plugin.c
diff options
context:
space:
mode:
authorDaniel Thompson <[email protected]>2020-02-13 09:57:24 +0000
committerDaniel Thompson <[email protected]>2020-04-01 16:59:02 +0100
commitd228bee8201a7ea77c414f1298b2f572f42c6113 (patch)
tree32d72ed695779f3ce53c5a566588857319bc81fa /scripts/gcc-plugins/cyc_complexity_plugin.c
parent7111951b8d4973bda27ff663f2cf18b663d15b48 (diff)
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 <[email protected]> Reviewed-by: Douglas Anderson <[email protected]>
Diffstat (limited to 'scripts/gcc-plugins/cyc_complexity_plugin.c')
0 files changed, 0 insertions, 0 deletions