From 8822ecf7a18c6977ac09b707ff720e503e81bfaf Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sun, 12 Sep 2021 23:22:47 +0200 Subject: [PATCH] Curl_hsts_loadcb: don't attempt to load if hsts wasn't inited Reported-by: Jonathan Cardoso Fixes #7710 Closes #7711 --- lib/hsts.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/hsts.c b/lib/hsts.c index 0d5a584012..853c7dfea5 100644 --- a/lib/hsts.c +++ b/lib/hsts.c @@ -526,7 +526,9 @@ CURLcode Curl_hsts_loadfile(struct Curl_easy *data, */ CURLcode Curl_hsts_loadcb(struct Curl_easy *data, struct hsts *h) { - return hsts_pull(data, h); + if(h) + return hsts_pull(data, h); + return CURLE_OK; } #endif /* CURL_DISABLE_HTTP || CURL_DISABLE_HSTS */ -- 2.47.2