From: Steve Holme Date: Tue, 2 Dec 2014 21:04:23 +0000 (+0000) Subject: smb: Don't try to connect with empty credentials X-Git-Tag: curl-7_40_0~256 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f9b7132175ed7b789d3c39452db3e2e216e5fc21;p=thirdparty%2Fcurl.git 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 --- diff --git a/lib/smb.c b/lib/smb.c index 326b231c61..d990a892f6 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;