audk/CryptoPkg/Library/BaseCryptLib/SysCall
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
..
BaseMemAllocation.c CryptoPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
ConstantTimeClock.c CryptoPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
CrtWrapper.c CryptoPkg: Fix BaseCryptLib CrtWrapper strncpy and strcat 2024-06-07 13:23:04 +00:00
RuntimeMemAllocation.c CryptoPkg: Apply uncrustify changes 2021-12-07 17:24:28 +00:00
TimerWrapper.c CryptoPkg/BaseCryptLib:time overflow 2022-12-03 09:01:38 +00:00
UnitTestHostCrtWrapper.c CryptoPkg/BaseCryptLib: drop BIO_* dummy functions 2023-08-09 07:10:31 +00:00