From b3f9c1aa09cbcdf6350d627f79f7d0e86cb178d3 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 6 Dec 2021 11:19:52 +0100 Subject: [PATCH] http2:set_transfer_url() return early on OOM If curl_url() returns NULL this should return early to avoid mistakes - even if right now the subsequent function invokes are all OK. Coverity (wrongly) pointed out this as a NULL deref. Closes #8100 --- lib/http2.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/http2.c b/lib/http2.c index 992fbbb26d..e74400a4ca 100644 --- a/lib/http2.c +++ b/lib/http2.c @@ -505,10 +505,13 @@ static int set_transfer_url(struct Curl_easy *data, struct curl_pushheaders *hp) { const char *v; - CURLU *u = curl_url(); CURLUcode uc; char *url = NULL; int rc = 0; + CURLU *u = curl_url(); + + if(!u) + return 5; v = curl_pushheader_byname(hp, ":scheme"); if(v) { -- 2.47.3