summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/DummyOpensslSupport.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/DummyOpensslSupport.c b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/DummyOpensslSupport.c
index d3786f0e2a..3b5f430378 100644
--- a/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/DummyOpensslSupport.c
+++ b/CryptoPkg/Library/BaseCryptLibMbedTls/SysCall/DummyOpensslSupport.c
@@ -258,9 +258,28 @@ strcpy (
const char *strSource
)
{
- // AsciiStrCpyS (strDest, MAX_STRING_SIZE, strSource);
- // return strDest;
- return NULL;
+ AsciiStrCpyS (strDest, AsciiStrnSizeS (strSource, MAX_STRING_SIZE - 1), strSource);
+ return strDest;
+}
+
+char *
+strncpy (
+ char *strDest,
+ const char *strSource,
+ size_t count
+ )
+{
+ UINTN DestMax = MAX_STRING_SIZE;
+
+ if (count < MAX_STRING_SIZE) {
+ DestMax = count + 1;
+ } else {
+ count = MAX_STRING_SIZE-1;
+ }
+
+ AsciiStrnCpyS (strDest, DestMax, strSource, (UINTN)count);
+
+ return strDest;
}
//