svn commit: samba r14259 - in branches/SAMBA_3_0/source/nsswitch: .

jra at samba.org jra at samba.org
Mon Mar 13 00:05:48 GMT 2006


Author: jra
Date: 2006-03-13 00:05:47 +0000 (Mon, 13 Mar 2006)
New Revision: 14259

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=14259

Log:
Fix coverity #42. Ensure contact_domain can't be null derefed
in error code path.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c	2006-03-13 00:00:46 UTC (rev 14258)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd_pam.c	2006-03-13 00:05:47 UTC (rev 14259)
@@ -1583,7 +1583,8 @@
 
 	parse_domain_user(state->request.data.chauthtok.user, domain, user);
 
-	if (!(contact_domain = find_domain_from_name(domain))) {
+	contact_domain = find_domain_from_name(domain);
+	if (!contact_domain) {
 		DEBUG(3, ("Cannot change password for [%s] -> [%s]\\[%s] as %s is not a trusted domain\n", 
 			  state->request.data.chauthtok.user, domain, user, domain)); 
 		result = NT_STATUS_NO_SUCH_USER;
@@ -1650,7 +1651,7 @@
 		}
 	}		
 
-	if (!NT_STATUS_IS_OK(result) && !got_info) {
+	if (!NT_STATUS_IS_OK(result) && !got_info && contact_domain) {
 
 		NTSTATUS policy_ret;
 		
@@ -1680,10 +1681,11 @@
 	       state->response.data.auth.nt_status_string,
 	       state->response.data.auth.pam_error));	      
 
-	if (NT_STATUS_IS_OK(result))
+	if (NT_STATUS_IS_OK(result)) {
 		request_ok(state);
-	else
+	} else {
 		request_error(state);
+	}
 }
 
 void winbindd_pam_logoff(struct winbindd_cli_state *state)



More information about the samba-cvs mailing list