libfreerdp: core: deep copy ServerCertificate

This commit is contained in:
mingfang 2021-02-12 10:27:24 +08:00 committed by akallabeth
parent e0d684e3e9
commit 99fa312079

View File

@ -701,6 +701,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);