diff options
author | Brad King <brad.king@kitware.com> | 2018-10-31 13:46:23 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-10-31 13:46:23 (GMT) |
commit | 636bcefeab3b386e65efe03b199b9b2614d8a78d (patch) | |
tree | 7198834e3a8ff6ce1facc9d14efcd1160e7681bd /Utilities/cmcurl/lib/vtls/schannel_verify.c | |
parent | 9c6574795c404417939c889d8cb45095c4175474 (diff) | |
parent | 9835e9075037db3d23ade0ef865c562b08cf6023 (diff) | |
download | CMake-636bcefeab3b386e65efe03b199b9b2614d8a78d.zip CMake-636bcefeab3b386e65efe03b199b9b2614d8a78d.tar.gz CMake-636bcefeab3b386e65efe03b199b9b2614d8a78d.tar.bz2 |
Merge branch 'upstream-curl' into update-curl
* upstream-curl:
curl 2018-10-30 (19667715)
Diffstat (limited to 'Utilities/cmcurl/lib/vtls/schannel_verify.c')
-rw-r--r-- | Utilities/cmcurl/lib/vtls/schannel_verify.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/Utilities/cmcurl/lib/vtls/schannel_verify.c b/Utilities/cmcurl/lib/vtls/schannel_verify.c index 5a7092a..2516f56 100644 --- a/Utilities/cmcurl/lib/vtls/schannel_verify.c +++ b/Utilities/cmcurl/lib/vtls/schannel_verify.c @@ -135,7 +135,7 @@ static CURLcode add_certs_to_store(HCERTSTORE trust_store, failf(data, "schannel: CA file exceeds max size of %u bytes", MAX_CAFILE_SIZE); - result = CURLE_OUT_OF_MEMORY; + result = CURLE_SSL_CACERT_BADFILE; goto cleanup; } @@ -244,7 +244,7 @@ static CURLcode add_certs_to_store(HCERTSTORE trust_store, CertFreeCertificateContext(cert_context); if(!add_cert_result) { failf(data, - "schannel: failed to add certificate from CA file '%s'" + "schannel: failed to add certificate from CA file '%s' " "to certificate store: %s", ca_file, Curl_strerror(conn, GetLastError())); result = CURLE_SSL_CACERT_BADFILE; @@ -319,6 +319,10 @@ static CURLcode verify_host(struct Curl_easy *data, * embedded null bytes. This appears to be undocumented behavior. */ cert_hostname_buff = (LPTSTR)malloc(len * sizeof(TCHAR)); + if(!cert_hostname_buff) { + result = CURLE_OUT_OF_MEMORY; + goto cleanup; + } actual_len = CertGetNameString(pCertContextServer, CERT_NAME_DNS_TYPE, name_flags, |