From b0f7d819bd7dee594f02eb4d5a036d8bff3afea8 Mon Sep 17 00:00:00 2001 From: David Garske Date: Thu, 23 Jun 2016 18:14:22 -0700 Subject: [PATCH] Cleanup of DerBuffer duplication that was using memcpy still after refractor and should be direct pointer copy. --- src/ssl.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ssl.c b/src/ssl.c index 82295ef6c..7c1ea1935 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -3874,7 +3874,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, } #endif } - XMEMCPY(&ssl->buffers.certificate, &der, sizeof(der)); + ssl->buffers.certificate = der; #ifdef KEEP_OUR_CERT ssl->keepCert = 1; /* hold cert for ssl lifetime */ #endif @@ -3889,7 +3889,7 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, ctx->ourCert = NULL; } #endif - XMEMCPY(&ctx->certificate, &der, sizeof(der)); + ctx->certificate = der; } } else if (type == PRIVATEKEY_TYPE) { @@ -3898,12 +3898,12 @@ static int ProcessBuffer(WOLFSSL_CTX* ctx, const unsigned char* buff, if (ssl->buffers.weOwnKey) { FreeDer(&ssl->buffers.key); } - XMEMCPY(&ssl->buffers.key, &der, sizeof(der)); + ssl->buffers.key = der; ssl->buffers.weOwnKey = 1; } else if (ctx) { FreeDer(&ctx->privateKey); - XMEMCPY(&ctx->privateKey, &der, sizeof(der)); + ctx->privateKey = der; } } else {