checksrc: ban strcpy

No longer used in the codebase. Replacement is `curlx_strcopy()`, possibly
`memcpy()` or dynbuf.

Also:
- OS400: allow three calls.

Closes #20088
This commit is contained in:
Viktor Szakats
2025-12-24 01:08:58 +01:00
parent 532d134767
commit 8636ad55df
2 changed files with 4 additions and 0 deletions

View File

@@ -711,6 +711,7 @@ char *Curl_ldap_get_dn_a(void *ld, LDAPMessage *entry)
ldap_memfree() and ldap_memalloc() does not exist. The solution is to
overwrite the EBCDIC buffer with ASCII to return it. */
/* !checksrc! disable BANNEDFUNC 1 */
strcpy(cp, cp2);
free(cp2);
return cp;
@@ -741,6 +742,7 @@ char *Curl_ldap_first_attribute_a(void *ld, LDAPMessage *entry,
ldap_memfree() and ldap_memalloc() does not exist. The solution is to
overwrite the EBCDIC buffer with ASCII to return it. */
/* !checksrc! disable BANNEDFUNC 1 */
strcpy(cp, cp2);
free(cp2);
return cp;
@@ -771,6 +773,7 @@ char *Curl_ldap_next_attribute_a(void *ld, LDAPMessage *entry,
ldap_memfree() and ldap_memalloc() does not exist. The solution is to
overwrite the EBCDIC buffer with ASCII to return it. */
/* !checksrc! disable BANNEDFUNC 1 */
strcpy(cp, cp2);
free(cp2);
return cp;

View File

@@ -110,6 +110,7 @@ my %banfunc = (
"sscanf" => 1,
"stat" => 1,
"strcat" => 1,
"strcpy" => 1,
"strdup" => 1,
"strerror" => 1,
"strncat" => 1,