svn commit: samba r25020 - in branches: SAMBA_3_2/source/nsswitch SAMBA_3_2_0/source/nsswitch

jra at samba.org jra at samba.org
Sat Sep 8 04:57:18 GMT 2007


Author: jra
Date: 2007-09-08 04:57:17 +0000 (Sat, 08 Sep 2007)
New Revision: 25020

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

Log:
Fix coverity #374, possible null deref.
Jeremy.

Modified:
   branches/SAMBA_3_2/source/nsswitch/winbindd_util.c
   branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c


Changeset:
Modified: branches/SAMBA_3_2/source/nsswitch/winbindd_util.c
===================================================================
--- branches/SAMBA_3_2/source/nsswitch/winbindd_util.c	2007-09-08 04:45:59 UTC (rev 25019)
+++ branches/SAMBA_3_2/source/nsswitch/winbindd_util.c	2007-09-08 04:57:17 UTC (rev 25020)
@@ -146,7 +146,7 @@
 	/* See if we found a match.  Check if we need to update the
 	   SID. */
 
-	if ( domain ) {
+	if ( domain && sid) {
 		if ( sid_equal( &domain->sid, &global_sid_NULL ) )
 			sid_copy( &domain->sid, sid );
 
@@ -305,10 +305,10 @@
 			}			
 		}
 
-			/* use the real alt_name if we have one, else pass in NULL */
+		/* use the real alt_name if we have one, else pass in NULL */
 
-			if ( !strequal( alt_name, "(null)" ) )
-				alternate_name = alt_name;
+		if ( !strequal( alt_name, "(null)" ) )
+			alternate_name = alt_name;
 
 		/* If we have an existing domain structure, calling
  		   add_trusted_domain() will update the SID if

Modified: branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c
===================================================================
--- branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c	2007-09-08 04:45:59 UTC (rev 25019)
+++ branches/SAMBA_3_2_0/source/nsswitch/winbindd_util.c	2007-09-08 04:57:17 UTC (rev 25020)
@@ -147,7 +147,7 @@
 	/* See if we found a match.  Check if we need to update the
 	   SID. */
 
-	if ( domain ) {
+	if ( domain && sid) {
 		if ( sid_equal( &domain->sid, &global_sid_NULL ) )
 			sid_copy( &domain->sid, sid );
 
@@ -306,10 +306,10 @@
 			}			
 		}
 
-			/* use the real alt_name if we have one, else pass in NULL */
+		/* use the real alt_name if we have one, else pass in NULL */
 
-			if ( !strequal( alt_name, "(null)" ) )
-				alternate_name = alt_name;
+		if ( !strequal( alt_name, "(null)" ) )
+			alternate_name = alt_name;
 
 		/* If we have an existing domain structure, calling
  		   add_trusted_domain() will update the SID if



More information about the samba-cvs mailing list