From 8f80ea1fadad76b18b6b56b967a25d1027c71b2f Mon Sep 17 00:00:00 2001 From: Wyatt O'Day Date: Mon, 4 Aug 2025 12:23:08 -0400 Subject: [PATCH] Fix runtime error when `ssl_cert_type` is not set. --- lib/vtls/mbedtls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/vtls/mbedtls.c b/lib/vtls/mbedtls.c index 1fad125e14..74b5278e5a 100644 --- a/lib/vtls/mbedtls.c +++ b/lib/vtls/mbedtls.c @@ -551,7 +551,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* if DER or a null-terminated PEM just process using * mbedtls_x509_crt_parse(). * */ - if(strcmp(ssl_cert_type, "DER") == 0 + if((ssl_cert_type && strcmp(ssl_cert_type, "DER") == 0) || ((char *)(ca_info_blob->data))[ca_info_blob->len - 1] == '\0' ) { ret = mbedtls_x509_crt_parse(&backend->cacert, @@ -651,7 +651,7 @@ mbed_connect_step1(struct Curl_cfilter *cf, struct Curl_easy *data) /* if DER or a null-terminated PEM just process using * mbedtls_x509_crt_parse(). * */ - if(strcmp(ssl_cert_type, "DER") == 0 + if((ssl_cert_type && strcmp(ssl_cert_type, "DER") == 0) || ((char *)(ssl_cert_blob->data))[ssl_cert_blob->len - 1] == '\0' ) { ret = mbedtls_x509_crt_parse(&backend->clicert,