diff options
author | Jeremy Allison <jra@samba.org> | 2006-03-29 23:22:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 11:15:48 -0500 |
commit | d0c0079ef87600ef32964da3483255fb57b717db (patch) | |
tree | 117e16cab23d7c4965d7c4389b3613ac5813eb6e /source3 | |
parent | ba49732bcf613d284646e021ddca3599ad1e7edf (diff) | |
download | samba-d0c0079ef87600ef32964da3483255fb57b717db.tar.gz samba-d0c0079ef87600ef32964da3483255fb57b717db.tar.bz2 samba-d0c0079ef87600ef32964da3483255fb57b717db.zip |
r14780: Fix coverity bug #272, null deref.
Jeremy.
(This used to be commit 1588ce8efe7fafd89561b55a98c498f947f4ada9)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/passdb/pdb_get_set.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source3/passdb/pdb_get_set.c b/source3/passdb/pdb_get_set.c index f704c5c481..5cb72e7f86 100644 --- a/source3/passdb/pdb_get_set.c +++ b/source3/passdb/pdb_get_set.c @@ -228,6 +228,10 @@ const DOM_SID *pdb_get_group_sid(struct samu *sampass) 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 @@ BOOL pdb_set_plaintext_passwd (struct samu *sampass, const char *plaintext) /* 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, |