From b27470405c054a163aee5724327d35b10da6eaa8 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Fri, 30 Nov 2018 11:41:51 +0100 Subject: [PATCH] Duplicate PEM when accepted. --- libfreerdp/crypto/tls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index 31d5fda..5c70b55 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -1189,23 +1189,23 @@ static BOOL is_accepted(rdpTls* tls, const BYTE* pem, size_t length) return FALSE; } -static BOOL accept_cert(rdpTls* tls, BYTE* pem, UINT32 length) +static BOOL accept_cert(rdpTls* tls, const BYTE* pem, UINT32 length) { rdpSettings* settings = tls->settings; if (tls->isGatewayTransport) { - settings->GatewayAcceptedCert = (char*)pem; + settings->GatewayAcceptedCert = _strdup(pem); settings->GatewayAcceptedCertLength = length; } else if (is_redirected(tls)) { - settings->RedirectionAcceptedCert = (char*)pem; + settings->RedirectionAcceptedCert = _strdup(pem); settings->RedirectionAcceptedCertLength = length; } else { - settings->AcceptedCert = (char*)pem; + settings->AcceptedCert = _strdup(pem); settings->AcceptedCertLength = length; } -- 2.7.4