summaryrefslogtreecommitdiffstats
path: root/crypto/o_str.c
diff options
context:
space:
mode:
authorPauli <paul.dale@oracle.com>2017-09-12 09:13:00 +1000
committerPauli <paul.dale@oracle.com>2017-09-14 10:26:54 +1000
commit4cacc9d510c20368d13dcaf2c95c25d6d1ceef6c (patch)
tree9002903f4a5d89582cac7602d41df7903c7e277d /crypto/o_str.c
parenteff1752b66cb7bf6ca8af816eb10ead26910d025 (diff)
Revert "GH614: Use memcpy()/strdup() when possible"
This reverts commit a89c9a0d855bce735116acfe147b24e386f566ba. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/4357)
Diffstat (limited to 'crypto/o_str.c')
-rw-r--r--crypto/o_str.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/crypto/o_str.c b/crypto/o_str.c
index cf098fc90a..a8357691ad 100644
--- a/crypto/o_str.c
+++ b/crypto/o_str.c
@@ -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;
}