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>
This commit is contained in:
Elyes Haouas 2022-04-12 13:12:19 +02:00 committed by Martin L Roth
parent 8f59960fb2
commit f0e150c35a
1 changed files with 6 additions and 0 deletions

View File

@ -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 &&