diff --git a/src/ssl.c b/src/ssl.c index e428d828a..a8d61789f 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -26895,8 +26895,8 @@ int EncryptDerKey(byte *der, int *derSz, const EVP_CIPHER* cipher, #endif return WOLFSSL_FAILURE; } - XSTRCPY((char*)*cipherInfo, info->name); - XSTRNCAT((char*)*cipherInfo, ",", 2); + XSTRLCPY((char*)*cipherInfo, info->name, cipherInfoSz); + XSTRLCAT((char*)*cipherInfo, ",", cipherInfoSz); idx = (word32)XSTRLEN((char*)*cipherInfo); cipherInfoSz -= idx; diff --git a/wolfssl/wolfcrypt/types.h b/wolfssl/wolfcrypt/types.h index efa2dc851..d7c4a4dfd 100644 --- a/wolfssl/wolfcrypt/types.h +++ b/wolfssl/wolfcrypt/types.h @@ -616,7 +616,6 @@ decouple library dependencies with standard string, memory and so on. #define XSTRLEN(s1) strlen((s1)) #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n)) - #define XSTRCPY(s1,s2) strcpy((s1),(s2)) /* strstr, strncmp, strcmp, and strncat only used by wolfSSL proper, * not required for wolfCrypt only */ #define XSTRSTR(s1,s2) strstr((s1),(s2))