add a warning for strlcat()
Signed-off-by: Manuel Ebner <[email protected]>
---
scripts/checkpatch.pl | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index 0492d6afc9a1..ca1a8e67d529 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -7085,6 +7085,12 @@ sub process {
"Prefer strscpy over strlcpy - see:
https://github.com/KSPP/linux/issues/89\n" . $herecurr);
}
+# strlcat uses that should likely be
+ if ($line =~ /\bstrlcat\s*\(/ && !is_userspace($realfile)) {
+ WARN("STRLCAT",
+ "Prefer seq_buf_printf() over strlcat - see:
https://github.com/KSPP/linux/issues/370\n" . $herecurr);
+ }
+
# strncpy uses that should likely be strscpy or strscpy_pad
if ($line =~ /\bstrncpy\s*\(/ && !is_userspace($realfile)) {
WARN("STRNCPY",
--
2.54.0