u-boot/scripts
Sean Anderson d9c3050710 checkpatch: Add warnings for using strn(cat|cpy)
strn(cat|cpy) has a bad habit of not nul-terminating the destination,
resulting in constructions like

	strncpy(foo, bar, sizeof(foo) - 1);
	foo[sizeof(foo) - 1] = '\0';

However, it is very easy to forget about this behavior and accidentally
leave a string unterminated. This has shown up in some recent coverity
scans [1, 2] (including code recently touched by yours truly).

Fortunately, the guys at OpenBSD came up with strl(cat|cpy), which always
nul-terminate strings. These functions are already in U-Boot, so we should
encourage new code to use them instead of strn(cat|cpy).

[1] https://lists.denx.de/pipermail/u-boot/2021-March/442888.html
[2] https://lists.denx.de/pipermail/u-boot/2021-January/438073.html

Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2021-04-12 17:44:55 -04:00
..
basic fixdep: fix coding style in previous fix 2020-08-04 23:30:02 -04:00
coccinelle
dtc dtc: Update the build rule for pylibfdt 2021-04-06 16:33:10 +12:00
kconfig
.gitignore
Kbuild.include
Kconfig.include kconfig: Add scripts/Kconfig.include from v4.19 2020-07-01 10:11:03 -04:00
Lindent
Makefile
Makefile.autoconf remove include/config_defaults.h 2020-07-17 10:47:19 -04:00
Makefile.build
Makefile.clean
Makefile.extrawarn
Makefile.host
Makefile.lib build/DTC: fix sed usage in DTC command 2021-02-24 16:51:48 -05:00
Makefile.spl Makefile: Remove old of-platdata files before regenerating 2021-03-26 17:03:08 +13:00
Makefile.uncmd_spl
bin2c.c
binutils-version.sh
build-whitelist.sh
build_OID_registry
check-config.sh scripts/check-config.sh: fix to be compatible with BSD sed 2021-02-24 16:51:48 -05:00
checkpatch.pl checkpatch: Add warnings for using strn(cat|cpy) 2021-04-12 17:44:55 -04:00
checkstack.pl
cleanpatch
coccicheck
config_whitelist.txt Merge branch '2021-04-11-remove-non-migrated-boards' 2021-04-11 14:11:05 -04:00
const_structs.checkpatch
coreboot.sed
decodecode
documentation-file-ref-check
gcc-stack-usage.sh
gcc-version.sh
get_default_envs.sh
get_maintainer.pl
kernel-doc doc: update Kernel documentation build system 2021-01-27 12:52:57 +01:00
ld-version.sh
mailmapper
mkmakefile
objdiff
setlocalversion scripts/setlocalversion: sync with linux 5.8 2020-08-27 15:55:18 -04:00
show-gnu-make
spelling.txt