mirror of
https://github.com/FreeRDP/FreeRDP.git
synced 2024-11-28 04:14:08 +08:00
[proxy,config] PEM length must contain '\0'
This commit is contained in:
parent
01e4624ed7
commit
7212621eae
@ -219,7 +219,7 @@ char* crypto_read_pem(const char* filename, size_t* plength)
|
||||
goto fail;
|
||||
|
||||
if (plength)
|
||||
*plength = (size_t)size;
|
||||
*plength = (size_t)strnlen(pem, size);
|
||||
fclose(fp);
|
||||
return pem;
|
||||
|
||||
|
@ -480,6 +480,7 @@ static BOOL pf_config_load_certificates(wIniFile* ini, proxyConfig* config)
|
||||
crypto_read_pem(config->CertificateFile, &config->CertificatePEMLength);
|
||||
if (!config->CertificatePEM)
|
||||
return FALSE;
|
||||
config->CertificatePEMLength += 1;
|
||||
}
|
||||
tmp2 = pf_config_get_str(ini, section_certificates, key_cert_content, FALSE);
|
||||
if (tmp2)
|
||||
@ -526,6 +527,7 @@ static BOOL pf_config_load_certificates(wIniFile* ini, proxyConfig* config)
|
||||
crypto_read_pem(config->PrivateKeyFile, &config->PrivateKeyPEMLength);
|
||||
if (!config->PrivateKeyPEM)
|
||||
return FALSE;
|
||||
config->PrivateKeyPEMLength += 1;
|
||||
}
|
||||
tmp2 = pf_config_get_str(ini, section_certificates, key_private_key_content, FALSE);
|
||||
if (tmp2)
|
||||
|
Loading…
Reference in New Issue
Block a user