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 coccinelle: adjust NULL check before free() 2020-04-24 16:40:09 -04:00
dtc dtc: Update the build rule for pylibfdt 2021-04-06 16:33:10 +12:00
kconfig kconfig / kbuild: Re-sync with Linux 4.19 2020-04-10 11:18:32 -04:00
.gitignore docproc: Remove 2018-08-03 19:53:54 -04:00
bin2c.c scripts: import bin2c.c from Linux 4.10-rc6 2017-02-08 15:56:19 -05:00
binutils-version.sh scripts: fix binutils-version.sh for 'as' without a package. 2015-01-08 11:00:45 -05:00
build-whitelist.sh sunxi: Fix CONFIG_SUNXI_GMAC references 2017-09-01 20:48:27 +05:30
build_OID_registry lib: add oid registry utility 2019-12-06 16:44:20 -05:00
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 avr32: Retire AVR32 for good 2017-07-06 16:17:19 -04:00
cleanpatch Makefile: Move some scripts imported from Linux 2013-12-13 09:18:45 -05:00
coccicheck Makefile: add coccicheck target 2017-11-20 20:18:38 -05:00
config_whitelist.txt Merge branch '2021-04-11-remove-non-migrated-boards' 2021-04-11 14:11:05 -04:00
const_structs.checkpatch checkpatch: update from Linux v4.13-rc6 2017-09-14 21:33:00 -04:00
coreboot.sed SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
decodecode scripts: add decodecode from Linux 2018-05-23 22:06:41 -04:00
documentation-file-ref-check scripts: add documentation-file-ref-check 2020-04-17 12:32:36 -04:00
gcc-stack-usage.sh SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
gcc-version.sh kbuild: Make scripts executable 2014-11-12 13:25:42 -05:00
get_default_envs.sh scripts/get_default_envs.sh: preserve order of multiple entries for same variable 2020-05-06 15:12:48 -04:00
get_maintainer.pl get_maintainer.pl: update from Linux kernel v4.16 2018-04-10 15:19:14 -04:00
Kbuild.include kbuild: cherry-pick kbuild changes from Linux 2020-04-24 16:40:09 -04:00
Kconfig.include kconfig: Add scripts/Kconfig.include from v4.19 2020-07-01 10:11:03 -04:00
kernel-doc doc: update Kernel documentation build system 2021-01-27 12:52:57 +01:00
ld-version.sh scripts/ld-version.sh: regular expression compile fails 2017-11-20 20:18:37 -05:00
Lindent scripts/Lindent: import from Linux 3.16 2014-08-21 12:01:29 -04:00
mailmapper scripts: mailmapper: SPDX license identifier 2018-06-04 11:25:30 -04:00
Makefile docproc: Remove 2018-08-03 19:53:54 -04:00
Makefile.autoconf remove include/config_defaults.h 2020-07-17 10:47:19 -04:00
Makefile.build kbuild: cherry-pick kbuild changes from Linux 2020-04-24 16:40:09 -04:00
Makefile.clean kconfig / kbuild: Re-sync with Linux 4.19 2020-04-10 11:18:32 -04:00
Makefile.extrawarn kbuild: Re-sync DTC flag logic with v4.17 2020-03-16 12:49:09 -04:00
Makefile.host kbuild: cherry-pick kbuild changes from Linux 2020-04-24 16:40:09 -04:00
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 dm: gpio: Allow control of GPIO uclass in SPL 2019-12-15 08:52:29 +08:00
mkmakefile kbuild: Make scripts executable 2014-11-12 13:25:42 -05:00
objdiff scripts: objdiff: Ignore debug info when comparing 2017-08-26 14:56:14 -04:00
setlocalversion scripts/setlocalversion: sync with linux 5.8 2020-08-27 15:55:18 -04:00
show-gnu-make SPDX: Convert all of our single license tags to Linux Kernel style 2018-05-07 09:34:12 -04:00
spelling.txt scripts/spelling.txt: Sync script with kernel 4.16-rc4 2018-03-05 10:16:30 -05:00