From: Jeremy Allison Date: Mon, 8 Aug 2016 23:53:21 +0000 (-0700) Subject: s3: libsmb: Protect cli_connect_nb_send() from being passed a NULL hostname and dest_ss. X-Git-Tag: tevent-0.9.30~171 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=27ebf64b347a770e0d1ad4f1db645cb1b8dd5861;p=thirdparty%2Fsamba.git s3: libsmb: Protect cli_connect_nb_send() from being passed a NULL hostname and dest_ss. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12135 Signed-off-by: Jeremy Allison Reviewed-by: Uri Simchoni --- diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c index ebba8f206e0..33759d9d87b 100644 --- a/source3/libsmb/cliconnect.c +++ b/source3/libsmb/cliconnect.c @@ -3108,11 +3108,15 @@ static struct tevent_req *cli_connect_nb_send( } state->desthost = host; - } else { + } else if (dest_ss != NULL) { state->desthost = print_canonical_sockaddr(state, dest_ss); if (tevent_req_nomem(state->desthost, req)) { return tevent_req_post(req, ev); } + } else { + /* No host or dest_ss given. Error out. */ + tevent_req_error(req, EINVAL); + return tevent_req_post(req, ev); } subreq = cli_connect_sock_send(state, ev, host, name_type, dest_ss,