]> granicus.if.org Git - curl/commitdiff
checksrc.pl: Added variants of strcat() & strncat() to banned function list
authorSteve Holme <steve_holme@hotmail.com>
Mon, 23 May 2016 11:13:41 +0000 (12:13 +0100)
committerSteve Holme <steve_holme@hotmail.com>
Mon, 23 May 2016 11:13:41 +0000 (12:13 +0100)
Added support for checking the tchar, unicode and mbcs variants of
strcat() and strncat() in the banned function list.

lib/checksrc.pl

index 24ea966f058bbc1aba26e8685aa7e0598bee2dd3..aacb242b5d829543c18efd7610e2d5f75426b478 100755 (executable)
@@ -421,7 +421,7 @@ sub scanfile {
         }
 
         # scan for use of banned functions
-        if($l =~ /^(.*\W)(sprintf|vsprintf|strcat|strncat|gets)\s*\(/) {
+        if($l =~ /^(.*\W)(sprintf|vsprintf|strcat|strncat|_mbscat|_mbsncat|_tcscat|_tcsncat|wcscat|wcsncat|gets)\s*\(/) {
             checkwarn("BANNEDFUNC",
                       $line, length($1), $file, $ol,
                       "use of $2 is banned");