mirror of https://github.com/moparisthebest/curl
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
This commit is contained in:
parent
bbccbfe9d1
commit
f9b7132175
|
@ -216,6 +216,10 @@ static CURLcode smb_connect(struct connectdata *conn, bool *done)
|
||||||
|
|
||||||
(void) 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 */
|
/* Initialize the connection state */
|
||||||
memset(smbc, 0, sizeof(*smbc));
|
memset(smbc, 0, sizeof(*smbc));
|
||||||
smbc->state = SMB_CONNECTING;
|
smbc->state = SMB_CONNECTING;
|
||||||
|
|
Loading…
Reference in New Issue