From 3a8317fddb979f95ff7ae3a6c2f44f95fe1723c1 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Tue, 3 Dec 2019 09:42:14 +0000 Subject: [PATCH] fetch_curl_report_certs_upstream: Use new SSL_CERT_ERR_CERT_MISSING Signed-off-by: Daniel Silverstone --- content/fetchers/curl.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/content/fetchers/curl.c b/content/fetchers/curl.c index cb09ecebd..0be33ae16 100644 --- a/content/fetchers/curl.c +++ b/content/fetchers/curl.c @@ -482,7 +482,11 @@ fetch_curl_report_certs_upstream(struct curl_fetch_info *f) memset(ssl_certs, 0, sizeof(ssl_certs)); for (depth = 0; depth <= f->cert_depth; depth++) { - assert(certs[depth].cert != NULL); + if (certs[depth].cert == NULL) { + /* This certificate is missing, skip it */ + ssl_certs[depth].err = SSL_CERT_ERR_CERT_MISSING; + continue; + } /* get certificate version */ ssl_certs[depth].version = X509_get_version(certs[depth].cert);