From 19a39b29e846e465ee97e7519acf14ddc9302198 Mon Sep 17 00:00:00 2001 From: "Dr. David von Oheimb" Date: Sat, 1 May 2021 19:26:53 +0200 Subject: [PATCH] OSSL_HTTP_REQ_CTX_add1_headers(): Fix use with host == NULL (relative URLs) Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/15053) --- crypto/http/http_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crypto/http/http_client.c b/crypto/http/http_client.c index a4eefad3158..9f41a31bf7a 100644 --- a/crypto/http/http_client.c +++ b/crypto/http/http_client.c @@ -286,7 +286,7 @@ static int OSSL_HTTP_REQ_CTX_add1_headers(OSSL_HTTP_REQ_CTX *rctx, const char *host) { int i; - int add_host = 1; + int add_host = host != NULL && *host != '\0'; CONF_VALUE *hdr; for (i = 0; i < sk_CONF_VALUE_num(headers); i++) { -- 2.47.3