BIO_PAIR_DEBUG did nothing; remove it.
[openssl.git] / crypto / o_str.c
index e96f62a2e80d7d5f0020ff909883bdecdf986e93..b200060917f4cbe780339f1a4bf2eac7a245527a 100644 (file)
@@ -1,4 +1,3 @@
-/* crypto/o_str.c -*- mode:C; c-file-style: "eay" -*- */
 /*
  * Written by Richard Levitte (richard@levitte.org) for the OpenSSL project
  * 2003.
@@ -121,12 +120,14 @@ 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;
-    ret = CRYPTO_malloc(strlen(str) + 1, file, line);
+    size = strlen(str) + 1;
+    ret = CRYPTO_malloc(size, file, line);
     if (ret != NULL)
-        strcpy(ret, str);
+        memcpy(ret, str, size);
     return ret;
 }