]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
rustls: verify that verifier_builder is not NULL
authorDaniel Stenberg <daniel@haxx.se>
Fri, 28 Nov 2025 22:59:23 +0000 (23:59 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 29 Nov 2025 21:46:07 +0000 (22:46 +0100)
Since this function returns allocated resources there is probably at
least a theoretical risk this can return NULL.

Pointed out by ZeroPath

Closes #19756

lib/vtls/rustls.c

index e4251a915198085076afc7b6fb8eb10760b4325d..0c13cc81eebb9944399a2ad5f8176ba4d3908ff5 100644 (file)
@@ -750,6 +750,10 @@ init_config_builder_verifier(struct Curl_easy *data,
   }
 
   verifier_builder = rustls_web_pki_server_cert_verifier_builder_new(roots);
+  if(!verifier_builder) {
+    result = CURLE_OUT_OF_MEMORY;
+    goto cleanup;
+  }
 
   if(conn_config->CRLfile) {
     result = init_config_builder_verifier_crl(data,