aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/http.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/http.c b/lib/http.c
index 9e2196ab2..95e06ecf8 100644
--- a/lib/http.c
+++ b/lib/http.c
@@ -125,7 +125,9 @@ static CURLcode Curl_output_basic(struct connectdata *conn)
char *authorization;
struct SessionHandle *data=conn->data;
- sprintf(data->state.buffer, "%s:%s", conn->user, conn->passwd);
+ sprintf(data->state.buffer, "%s:%s",
+ conn->user?conn->user:"",
+ conn->passwd?conn->passwd:"");
if(Curl_base64_encode(data->state.buffer, strlen(data->state.buffer),
&authorization) >= 0) {
if(conn->allocptr.userpwd)