aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-12-02 21:04:23 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-12-02 21:04:23 +0000
commitf9b7132175ed7b789d3c39452db3e2e216e5fc21 (patch)
treec27e66093466ad693d06d7d4b8b163e9b8466da0
parentbbccbfe9d1552473ddc380ae2dc7b261d3caf63d (diff)
smb: Don't try to connect with empty credentials
On some platforms curl would crash if no credentials were used. As such added detection of such a use case to prevent this from happening. Reported-by: Gisle Vanem
-rw-r--r--lib/smb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/smb.c b/lib/smb.c
index 326b231c6..d990a892f 100644
--- a/lib/smb.c
+++ b/lib/smb.c
@@ -216,6 +216,10 @@ static CURLcode smb_connect(struct connectdata *conn, bool *done)
(void) done;
+ /* Check we have a username and password to authenticate with */
+ if(!conn->bits.user_passwd)
+ return CURLE_LOGIN_DENIED;
+
/* Initialize the connection state */
memset(smbc, 0, sizeof(*smbc));
smbc->state = SMB_CONNECTING;