From 772bc22c945c92dddaf5b541df25787b830f4b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Trojnara?= Date: Thu, 19 Jun 2025 14:26:40 +0200 Subject: [PATCH] Handle null return from curl_easy_init --- osslsigncode.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/osslsigncode.c b/osslsigncode.c index 3bf0a0b..0104a19 100644 --- a/osslsigncode.c +++ b/osslsigncode.c @@ -627,6 +627,10 @@ static BIO *bio_get_http_curl(long *http_code, char *url, BIO *req, char *proxy, /* Start a libcurl easy session and set options for a curl easy handle */ printf("Connecting to %s\n", url); curl = curl_easy_init(); + if (!curl) { + fprintf(stderr, "CURL initialization failed\n"); + return NULL; /* FAILED */ + } if (proxy) { res = curl_easy_setopt(curl, CURLOPT_PROXY, proxy); if (res != CURLE_OK) {