diff options
author | Sebastian Witt <sebastian.witt@siemens.com> | 2024-06-04 13:38:26 +0200 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-06-07 13:23:04 +0000 |
commit | 948f23417010309a5557d46195eae258f6105025 (patch) | |
tree | a142990570ab67c67df3d5cf569824d7517a195f /OvmfPkg | |
parent | df8c61e4c071d1c6ab04e3ebeeb07cf97fc893e0 (diff) | |
download | edk2-948f23417010309a5557d46195eae258f6105025.zip edk2-948f23417010309a5557d46195eae258f6105025.tar.gz edk2-948f23417010309a5557d46195eae258f6105025.tar.bz2 |
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>
Diffstat (limited to 'OvmfPkg')
0 files changed, 0 insertions, 0 deletions