From 4cacc9d510c20368d13dcaf2c95c25d6d1ceef6c Mon Sep 17 00:00:00 2001 From: Pauli Date: Tue, 12 Sep 2017 09:13:00 +1000 Subject: Revert "GH614: Use memcpy()/strdup() when possible" This reverts commit a89c9a0d855bce735116acfe147b24e386f566ba. Reviewed-by: Rich Salz Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/4357) --- crypto/o_str.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'crypto/o_str.c') 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; } -- cgit v1.2.3