From d0c0079ef87600ef32964da3483255fb57b717db Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 29 Mar 2006 23:22:57 +0000 Subject: r14780: Fix coverity bug #272, null deref. Jeremy. (This used to be commit 1588ce8efe7fafd89561b55a98c498f947f4ada9) --- source3/passdb/pdb_get_set.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source3') 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, -- cgit