Martin L Roth has submitted this change. ( https://review.coreboot.org/c/coreboot/+/63581 )
Change subject: util/lint/checkpatch.pl: Add strlcpy check ......................................................................
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 --- M util/lint/checkpatch.pl 1 file changed, 6 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified Martin L Roth: Looks good to me, approved
diff --git a/util/lint/checkpatch.pl b/util/lint/checkpatch.pl index 1b9a3d4..8275daa 100755 --- a/util/lint/checkpatch.pl +++ b/util/lint/checkpatch.pl @@ -6238,6 +6238,12 @@ # } # }
+# 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=V6A6G1oUZcprmkn..." . $herecurr); + } + # typecasts on min/max could be min_t/max_t if ($perl_version_ok && defined $stat &&