summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2021-10-06 15:40:53 +0200
committerDaniel Stenberg <daniel@haxx.se>2021-10-06 22:45:52 +0200
commit87907d56f0a2973bb7513f073f4f5a02a01d2ef2 (patch)
treec19d517a0073c4d146f800b6a864345c612d98d9 /lib
parent5f563495f1f9cf7ef4f23f997e4c2707dd3e74a8 (diff)
downloadcurl-87907d56f0a2973bb7513f073f4f5a02a01d2ef2.tar.gz
http: fix Basic auth with empty name field in URL
Add test 367 to verify. Reported-by: Rick Lane Fixes #7819 Closes #7820
Diffstat (limited to 'lib')
-rw-r--r--lib/http.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c
index 648583c56..fe3f3a27b 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -323,7 +323,7 @@ static CURLcode http_output_basic(struct Curl_easy *data, bool proxy)
pwd = data->state.aptr.passwd;
}
- out = aprintf("%s:%s", user, pwd ? pwd : "");
+ out = aprintf("%s:%s", user ? user : "", pwd ? pwd : "");
if(!out)
return CURLE_OUT_OF_MEMORY;