← Commit list

c882439d53

Viktor Szakats
Viktor Szakats
2025-12-24
SUCCESS Duration: 192s

Subject

os400sys: replace `strcpy()` with `memcpy()`

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

packages/OS400/os400sys.c+12 -12
@@ -705,14 +705,14 @@ char *Curl_ldap_get_dn_a(void *ld, LDAPMessage *entry)
return cp2;
QadrtConvertE2A(cp2, cp, i, i);
- cp2[i] = '\0';
/* No way to allocate a buffer here, because it will be released by
ldap_memfree() and ldap_memalloc() does not exist. The solution is to
- overwrite the EBCDIC buffer with ASCII to return it. */
+ overwrite the EBCDIC buffer with ASCII to return it.
- /* !checksrc! disable BANNEDFUNC 1 */
- strcpy(cp, cp2);
+ The destination buffer already has a null-terminator at the correct
+ position. Keep it outouched and copy the buffer without a terminator. */
+ memcpy(cp, cp2, i);
free(cp2);
return cp;
}
@@ -736,14 +736,14 @@ char *Curl_ldap_first_attribute_a(void *ld, LDAPMessage *entry,
return cp2;
QadrtConvertE2A(cp2, cp, i, i);
- cp2[i] = '\0';
/* No way to allocate a buffer here, because it will be released by
ldap_memfree() and ldap_memalloc() does not exist. The solution is to
- overwrite the EBCDIC buffer with ASCII to return it. */
+ overwrite the EBCDIC buffer with ASCII to return it.
- /* !checksrc! disable BANNEDFUNC 1 */
- strcpy(cp, cp2);
+ The destination buffer already has a null-terminator at the correct
+ position. Keep it outouched and copy the buffer without a terminator. */
+ memcpy(cp, cp2, i);
free(cp2);
return cp;
}
@@ -767,14 +767,14 @@ char *Curl_ldap_next_attribute_a(void *ld, LDAPMessage *entry,
return cp2;
QadrtConvertE2A(cp2, cp, i, i);
- cp2[i] = '\0';
/* No way to allocate a buffer here, because it will be released by
ldap_memfree() and ldap_memalloc() does not exist. The solution is to
- overwrite the EBCDIC buffer with ASCII to return it. */
+ overwrite the EBCDIC buffer with ASCII to return it.
- /* !checksrc! disable BANNEDFUNC 1 */
- strcpy(cp, cp2);
+ The destination buffer already has a null-terminator at the correct
+ position. Keep it outouched and copy the buffer without a terminator. */
+ memcpy(cp, cp2, i);
free(cp2);
return cp;
}