From: Armin Novak Date: Fri, 7 Dec 2018 11:36:18 +0000 (+0100) Subject: Fix #5115: Cast PEM data from BYTE* to char* to silence warnings. X-Git-Tag: 2.0.0~600^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d05217454f0af8d97836c5689bbfa0eb556025c7;p=platform%2Fupstream%2Ffreerdp.git Fix #5115: Cast PEM data from BYTE* to char* to silence warnings. --- diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index 6b1c72f..d4689cb 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -1192,20 +1192,24 @@ static BOOL is_accepted(rdpTls* tls, const BYTE* pem, size_t length) static BOOL accept_cert(rdpTls* tls, const BYTE* pem, UINT32 length) { rdpSettings* settings = tls->settings; + char* dupPem = _strdup((const char*) pem); + + if (!dupPem) + return FALSE; if (tls->isGatewayTransport) { - settings->GatewayAcceptedCert = _strdup(pem); + settings->GatewayAcceptedCert = dupPem; settings->GatewayAcceptedCertLength = length; } else if (is_redirected(tls)) { - settings->RedirectionAcceptedCert = _strdup(pem); + settings->RedirectionAcceptedCert = dupPem; settings->RedirectionAcceptedCertLength = length; } else { - settings->AcceptedCert = _strdup(pem); + settings->AcceptedCert = dupPem; settings->AcceptedCertLength = length; }