From dd43748676ff80357e231fec7182b1969584f9a4 Mon Sep 17 00:00:00 2001 From: Daniel Silverstone Date: Sat, 23 May 2020 09:38:15 +0100 Subject: fix: Make it OK if the chain isn't avilable during bad-ssl querying Signed-off-by: Daniel Silverstone --- content/fetchers/about.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'content') diff --git a/content/fetchers/about.c b/content/fetchers/about.c index 532223fbb..6bb71a964 100644 --- a/content/fetchers/about.c +++ b/content/fetchers/about.c @@ -2199,7 +2199,7 @@ static bool fetch_about_query_privacy_handler(struct fetch_about_context *ctx) const char *title; struct nsurl *siteurl = NULL; char *description = NULL; - const char *chainurl = ""; + const char *chainurl = NULL; const struct fetch_multipart_data *curmd; /* mutipart data iterator */ /* extract parameters from multipart post data */ @@ -2261,16 +2261,24 @@ static bool fetch_about_query_privacy_handler(struct fetch_about_context *ctx) goto fetch_about_query_ssl_handler_aborted; } } - res = ssenddataf(ctx, - "

%s

" - "

%s

", - reason, - chainurl, - messages_get("ViewCertificates")); + + if (chainurl == NULL) { + res = ssenddataf(ctx, + "

%s

" + "

%s

", + reason, + messages_get("ViewCertificatesNotPossible")); + } else { + res = ssenddataf(ctx, + "

%s

" + "

%s

", + reason, + chainurl, + messages_get("ViewCertificates")); + } if (res != NSERROR_OK) { goto fetch_about_query_ssl_handler_aborted; } - res = ssenddataf(ctx, "
" "