summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-12-06 11:19:52 +0100
committerDaniel Stenberg <daniel@haxx.se>2021-12-06 11:19:52 +0100
commitb9b4f2289305c0ae61619d70defc8481b913bee4 (patch)
tree2be0f1b2260eccc89fc0b7f1b3754f98cde4fb03
parentbc064a8177f14fd69a6bcd7735b19ab84f3ba81d (diff)
downloadcurl-bagder/http2-set-url.tar.gz
http2:set_transfer_url() return early on OOMbagder/http2-set-url
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.
-rw-r--r--lib/http2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/http2.c b/lib/http2.c
index 992fbbb26..e74400a4c 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) {