]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Curl_hsts_loadcb: don't attempt to load if hsts wasn't inited
authorDaniel Stenberg <daniel@haxx.se>
Sun, 12 Sep 2021 21:22:47 +0000 (23:22 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sun, 12 Sep 2021 21:43:51 +0000 (23:43 +0200)
Reported-by: Jonathan Cardoso
Fixes #7710
Closes #7711

lib/hsts.c

index 0d5a584012e048024b0db9bd084ea2990d3bec57..853c7dfea5ab0709c030fd07d0e9f056ea461979 100644 (file)
@@ -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 */