summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorPavel Březina <pbrezina@redhat.com>2013-02-12 11:12:59 +0100
committerJakub Hrozek <jhrozek@redhat.com>2013-02-14 14:04:47 +0100
commit07b92f78d1751d8a2a538a440e1fdb24c59021e0 (patch)
tree21236d4b551b04149adfae9d486756d7f5e0124f /src/util
parent27cf6c28bc02e7a54487d44c212a98b165a70c34 (diff)
downloadsssd-07b92f78d1751d8a2a538a440e1fdb24c59021e0.tar.gz
sssd-07b92f78d1751d8a2a538a440e1fdb24c59021e0.tar.bz2
sssd-07b92f78d1751d8a2a538a440e1fdb24c59021e0.zip
get_next_domain() test dom->parent->next for NULL
Otherwise dom may be set to NULL and we will segfault when dereferencing dom.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/domain_info_utils.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c
index d8ca55da..039d66f8 100644
--- a/src/util/domain_info_utils.c
+++ b/src/util/domain_info_utils.c
@@ -33,7 +33,7 @@ struct sss_domain_info *get_next_domain(struct sss_domain_info *domain,
dom = dom->subdomains;
} else if (dom->next) {
dom = dom->next;
- } else if (descend && IS_SUBDOMAIN(dom)) {
+ } else if (descend && IS_SUBDOMAIN(dom) && dom->parent->next) {
dom = dom->parent->next;
} else {
return NULL;