diff options
author | Jeremy Allison <jra@samba.org> | 2006-12-09 02:58:18 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:16:24 -0500 |
commit | 0ffca7559e07500bd09a64b775e230d448ce5c24 (patch) | |
tree | 16019eb51c65b8f328abf4270a5acd44bb054d4b /source/lib/privileges.c | |
parent | 3d6f387783467bbd7ea88d6a853b41572badf1ef (diff) | |
download | samba-0ffca7559e07500bd09a64b775e230d448ce5c24.tar.gz samba-0ffca7559e07500bd09a64b775e230d448ce5c24.tar.xz samba-0ffca7559e07500bd09a64b775e230d448ce5c24.zip |
r20090: Fix a class of bugs found by James Peach. Ensure
we never mix malloc and talloc'ed contexts in the
add_XX_to_array() and add_XX_to_array_unique()
calls. Ensure that these calls always return
False on out of memory, True otherwise and always
check them. Ensure that the relevent parts of
the conn struct and the nt_user_tokens are
TALLOC_DESTROYED not SAFE_FREE'd.
James - this should fix your crash bug in both
branches.
Jeremy.
Diffstat (limited to 'source/lib/privileges.c')
-rw-r--r-- | source/lib/privileges.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/lib/privileges.c b/source/lib/privileges.c index 32535394c7d..c0f7857c95b 100644 --- a/source/lib/privileges.c +++ b/source/lib/privileges.c @@ -517,7 +517,9 @@ static int priv_traverse_fn(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void *s return 0; } - add_sid_to_array( NULL, &sid, &priv->sids.list, &priv->sids.count ); + if (!add_sid_to_array( NULL, &sid, &priv->sids.list, &priv->sids.count )) { + return 0; + } return 0; } |