svn commit: samba r16322 - in branches/SAMBA_3_0/source/libads: .

jra at samba.org jra at samba.org
Fri Jun 16 23:14:13 GMT 2006


Author: jra
Date: 2006-06-16 23:14:12 +0000 (Fri, 16 Jun 2006)
New Revision: 16322

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

Log:
Klocwork #481., Don't deref null on malloc fail.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/libads/ldap.c


Changeset:
Modified: branches/SAMBA_3_0/source/libads/ldap.c
===================================================================
--- branches/SAMBA_3_0/source/libads/ldap.c	2006-06-16 23:10:15 UTC (rev 16321)
+++ branches/SAMBA_3_0/source/libads/ldap.c	2006-06-16 23:14:12 UTC (rev 16322)
@@ -1956,8 +1956,10 @@
 		return NULL;
 	}
 	
-	memcpy(&strings[*num_strings], new_strings,
-	       sizeof(*new_strings) * num_new_strings);
+	if (new_strings && num_new_strings) {
+		memcpy(&strings[*num_strings], new_strings,
+		       sizeof(*new_strings) * num_new_strings);
+	}
 
 	(*num_strings) += num_new_strings;
 



More information about the samba-cvs mailing list