libfreerdp: core: deep copy ServerCertificate
@@ -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);
