summaryrefslogtreecommitdiffstats
path: root/util/lint
diff options
context:
space:
mode:
authorElyes Haouas <ehaouas@noos.fr>2022-04-12 13:12:19 +0200
committerMartin L Roth <martinroth@google.com>2022-04-24 21:18:55 +0000
commitf0e150c35aafa7b2f5ac4123a8de918f296de01c (patch)
treef0a7572ab9fc1ca453d7b14fb4aeb4120f1efd66 /util/lint
parent8f59960fb27d47e16e30ef7967e698d058ebc670 (diff)
downloadcoreboot-f0e150c35aafa7b2f5ac4123a8de918f296de01c.tar.gz
coreboot-f0e150c35aafa7b2f5ac4123a8de918f296de01c.tar.bz2
coreboot-f0e150c35aafa7b2f5ac4123a8de918f296de01c.zip
util/lint/checkpatch.pl: Add strlcpy check
Update to v5.18-2 Signed-off-by: Elyes Haouas <ehaouas@noos.fr> Change-Id: Ic4eaa3f26bcd60ea509a52d5715c7ce1f43b6d3d Reviewed-on: https://review.coreboot.org/c/coreboot/+/63581 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <martinroth@google.com>
Diffstat (limited to 'util/lint')
-rwxr-xr-xutil/lint/checkpatch.pl6
1 files changed, 6 insertions, 0 deletions
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl
index 1b9a3d4e672a..8275daaebf6b 100755
--- a/util/lint/checkpatch.pl
+++ b/util/lint/checkpatch.pl
@@ -6238,6 +6238,12 @@ sub process {
# }
# }
+# strlcpy uses that should likely be strscpy
+ if ($line =~ /\bstrlcpy\s*\(/) {
+ WARN("STRLCPY",
+ "Prefer strscpy over strlcpy - see: https://lore.kernel.org/r/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw\@mail.gmail.com/\n" . $herecurr);
+ }
+
# typecasts on min/max could be min_t/max_t
if ($perl_version_ok &&
defined $stat &&