aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorKees Cook <[email protected]>2013-07-03 15:04:55 -0700
committerLinus Torvalds <[email protected]>2013-07-03 16:07:41 -0700
commit096a8aac6bf4a5a0b2ef812ad76d056bbf3fb2af (patch)
treefa3721d6d2a96f69023624366afecb72e7b60eb6 /tools/perf/scripts/python
parente7152b97f38f1f5b915c719e6a3040697a700a16 (diff)
clean up scary strncpy(dst, src, strlen(src)) uses
Fix various weird constructions of strncpy(dst, src, strlen(src)). Length limits should be about the space available in the destination, not repurposed as a method to either always include or always exclude a trailing NULL byte. Either the NULL should always be copied (using strlcpy), or it should not be copied (using something like memcpy). Readable code should not depend on the weird behavior of strncpy when it hits the length limit. Better to avoid the anti-pattern entirely. [[email protected]: revert getdelays.c part due to missing bsd/string.h] Signed-off-by: Kees Cook <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> [staging] Acked-by: Rafael J. Wysocki <[email protected]> [acpi] Cc: Martin Schwidefsky <[email protected]> Cc: Heiko Carstens <[email protected]> Cc: Ursula Braun <[email protected]> Cc: Frank Blaschka <[email protected]> Cc: Richard Weinberger <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions