X-Git-Url: https://git.openssl.org/gitweb/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fo_str.c;h=a8357691ad66e9b668e28acad5f3b45eddab8fb8;hp=be130ce8047a40d84bba765a611f87e56a50d7ce;hb=f5cee414fa8e7e9a088d8d5ebe641f368df20801;hpb=bef7a81530442033ecb727196bddeb96d327acaf diff --git a/crypto/o_str.c b/crypto/o_str.c index be130ce804..a8357691ad 100644 --- a/crypto/o_str.c +++ b/crypto/o_str.c @@ -7,8 +7,8 @@ * https://www.openssl.org/source/license.html */ -#include #include "e_os.h" +#include #include #include "internal/cryptlib.h" #include "internal/o_str.h" @@ -27,14 +27,12 @@ int OPENSSL_memcmp(const void *v1, const void *v2, size_t n) char *CRYPTO_strdup(const char *str, const char* file, int line) { char *ret; - size_t size; if (str == NULL) return NULL; - size = strlen(str) + 1; - ret = CRYPTO_malloc(size, file, line); + ret = CRYPTO_malloc(strlen(str) + 1, file, line); if (ret != NULL) - memcpy(ret, str, size); + strcpy(ret, str); return ret; }