libsmb: Fix CID 1356312 Explicit null dereferenced
authorVolker Lendecke <vl@samba.org>
Tue, 15 Mar 2016 20:00:30 +0000 (21:00 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 17 Mar 2016 23:29:14 +0000 (00:29 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/libsmb/cliconnect.c

index 97d0352dac9a042d1041e2656b29710ff318f3b5..50d1a0c22c591c93c15b442597c914517b279b02 100644 (file)
@@ -1361,6 +1361,11 @@ static struct tevent_req *cli_session_setup_gensec_send(
                size_t converted;
                bool ok;
 
+               if (pass == NULL) {
+                       tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER_MIX);
+                       return tevent_req_post(req, ev);
+               }
+
                converted = strhex_to_str((char *)nt_hash.hash,
                                          sizeof(nt_hash.hash),
                                          pass, strlen(pass));