summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-06-13 17:55:39 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:17:24 -0500
commit15e26314b68b6f879ac494504f9e75c90ce289a0 (patch)
tree96187422a92ab2a8629bc239f4b25e90690581a5
parent668727d035e14eb03115007696f62a59bb1418d5 (diff)
downloadsamba-15e26314b68b6f879ac494504f9e75c90ce289a0.tar.gz
samba-15e26314b68b6f879ac494504f9e75c90ce289a0.tar.bz2
samba-15e26314b68b6f879ac494504f9e75c90ce289a0.zip
r16196: A bit of defensive programming:
Klocwork ID 1773 complained about oldest being dereferenced in line 2275 where it could be NULL. I think you can construct extreme racy conditions where this actually could happen. Volker (This used to be commit b5602cc4f1d77ed48ddca0f7f42b28706160c923)
-rw-r--r--source3/nsswitch/winbindd_cache.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/nsswitch/winbindd_cache.c b/source3/nsswitch/winbindd_cache.c
index 0c096352d3..481dc41c6f 100644
--- a/source3/nsswitch/winbindd_cache.c
+++ b/source3/nsswitch/winbindd_cache.c
@@ -2232,7 +2232,7 @@ NTSTATUS wcache_remove_oldest_cached_creds(struct winbindd_domain *domain, const
ret = tdb_traverse(cache->tdb, traverse_fn_get_credlist, NULL);
if (ret == 0) {
return NT_STATUS_OK;
- } else if (ret == -1) {
+ } else if ((ret == -1) || (wcache_cred_list == NULL)) {
return NT_STATUS_OBJECT_NAME_NOT_FOUND;
}