audk/CryptoPkg/Library/Include
Sebastian Witt 948f234170 CryptoPkg: Fix BaseCryptLib CrtWrapper strncpy and strcat
Following https://bugzilla.tianocore.org/show_bug.cgi?id=2817 this
bug could also apply to strncpy and strcat.

For strncpy use count+1 if smaller than MAX_STRING_SIZE. This still
restricts the destination size to MAX_STRING_SIZE as before but allows
a strncpy when the source is close after destination without triggering
the InternalSafeStringNoAsciiStrOverlap check in AsciiStrnCpyS.

For strcat use the destination string length + the size of the source
string including the terminator as destination size if smaller than
MAX_STRING_SIZE.

Also move both functions to CrtWrapper.c as they do not return the
correct return value. AsciiStrnCpyS and AsciiStrCatS return
RETURN_VALUE instead of a char * to the destination buffer.

Signed-off-by: Sebastian Witt <sebastian.witt@siemens.com>
2024-06-07 13:23:04 +00:00
..
arpa CryptoPkg/Crt: satisfy "inet_pton.c" dependencies (CVE-2019-14553) 2019-11-02 12:07:52 +01:00
netinet CryptoPkg/Crt: satisfy "inet_pton.c" dependencies (CVE-2019-14553) 2019-11-02 12:07:52 +01:00
sys CryptoPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CrtLibSupport.h CryptoPkg: Fix BaseCryptLib CrtWrapper strncpy and strcat 2024-06-07 13:23:04 +00:00
assert.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
ctype.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
errno.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
fcntl.h CryptoPkg/CrtLibSupport: add fcntl.h 2022-04-12 14:39:01 +00:00
inttypes.h CryptoPkg: Add dummy inttypes header to fix clang build 2024-01-22 03:02:37 +00:00
limits.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
memory.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
stdarg.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
stddef.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
stdint.h CryptoPkg: Fix redefinition error of int defines 2024-01-10 15:34:28 +00:00
stdio.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
stdlib.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
string.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
strings.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
stubs-32.h CryptoPkg: Add all .inf files for BaseCryptLibMbedTls 2023-10-12 05:31:19 +00:00
syslog.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
time.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00
unistd.h CryptoPkg: Replace BSD License with BSD+Patent License 2019-04-09 09:10:22 -07:00