svn commit: samba r16209 - in branches/SAMBA_3_0/source/auth: .
jra at samba.org
jra at samba.org
Tue Jun 13 21:21:44 GMT 2006
Author: jra
Date: 2006-06-13 21:21:44 +0000 (Tue, 13 Jun 2006)
New Revision: 16209
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=16209
Log:
Klocwork bug #66, ensure no null deref.
Jeremy.
Modified:
branches/SAMBA_3_0/source/auth/auth_util.c
Changeset:
Modified: branches/SAMBA_3_0/source/auth/auth_util.c
===================================================================
--- branches/SAMBA_3_0/source/auth/auth_util.c 2006-06-13 21:01:10 UTC (rev 16208)
+++ branches/SAMBA_3_0/source/auth/auth_util.c 2006-06-13 21:21:44 UTC (rev 16209)
@@ -1082,6 +1082,7 @@
/* This is a passdb user, so ask passdb */
struct samu *sam_acct = NULL;
+ const DOM_SID *gr_sid = NULL;
if ( !(sam_acct = samu_new( tmp_ctx )) ) {
goto done;
@@ -1094,8 +1095,14 @@
goto done;
}
- sid_copy(&primary_group_sid, pdb_get_group_sid(sam_acct));
+ gr_sid = pdb_get_group_sid(sam_acct);
+ if (!gr_sid) {
+ result = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
+ sid_copy(&primary_group_sid, gr_sid);
+
if (!sid_to_gid(&primary_group_sid, gid)) {
DEBUG(1, ("sid_to_gid(%s) failed\n",
sid_string_static(&primary_group_sid)));
More information about the samba-cvs
mailing list