svn commit: samba r14780 - in branches/SAMBA_3_0/source/passdb: .

jra at samba.org jra at samba.org
Wed Mar 29 23:22:57 GMT 2006


Author: jra
Date: 2006-03-29 23:22:57 +0000 (Wed, 29 Mar 2006)
New Revision: 14780

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

Log:
Fix coverity bug #272, null deref.
Jeremy.

Modified:
   branches/SAMBA_3_0/source/passdb/pdb_get_set.c


Changeset:
Modified: branches/SAMBA_3_0/source/passdb/pdb_get_set.c
===================================================================
--- branches/SAMBA_3_0/source/passdb/pdb_get_set.c	2006-03-29 23:19:06 UTC (rev 14779)
+++ branches/SAMBA_3_0/source/passdb/pdb_get_set.c	2006-03-29 23:22:57 UTC (rev 14780)
@@ -228,6 +228,10 @@
 		TALLOC_CTX *mem_ctx = talloc_init("pdb_get_group_sid");
 		BOOL lookup_ret;
 		
+		if (!mem_ctx) {
+			return NULL;
+		}
+
 		/* Now check that it's actually a domain group and not something else */
 
 		lookup_ret = lookup_sid(mem_ctx, gsid, NULL, NULL, &type);
@@ -1246,6 +1250,10 @@
 					/* Ensure we have space for the needed history. */
 					uchar *new_history = TALLOC(sampass,
 								pwHistLen*PW_HISTORY_ENTRY_LEN);
+					if (!new_history) {
+						return False;
+					}
+
 					/* And copy it into the new buffer. */
 					if (current_history_len) {
 						memcpy(new_history, pwhistory,



More information about the samba-cvs mailing list