From: mingfang Date: Fri, 12 Feb 2021 02:27:24 +0000 (+0800) Subject: libfreerdp: core: deep copy ServerCertificate X-Git-Tag: 2.3.0~13 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=707828df8fafe7bd101733a91e22a3ceefe25f1a;p=platform%2Fupstream%2Ffreerdp.git libfreerdp: core: deep copy ServerCertificate (cherry picked from commit b0783771055f55dccde85f8f5e50954ffca93383) --- diff --git a/libfreerdp/core/settings.c b/libfreerdp/core/settings.c index d70b2e5..7bccdd0 100644 --- a/libfreerdp/core/settings.c +++ b/libfreerdp/core/settings.c @@ -700,6 +700,17 @@ static BOOL freerdp_settings_int_buffer_copy(rdpSettings* _settings, const rdpSe _settings->ClientRandomLength = settings->ClientRandomLength; } + if (settings->ServerCertificateLength) + { + _settings->ServerCertificate = (BYTE*)malloc(settings->ServerCertificateLength); + + if (!_settings->ServerCertificate) + goto out_fail; + + CopyMemory(_settings->ServerCertificate, settings->ServerCertificate, _settings->ServerCertificateLength); + _settings->ServerCertificateLength = settings->ServerCertificateLength; + } + if (settings->RdpServerCertificate) { _settings->RdpServerCertificate = certificate_clone(settings->RdpServerCertificate);