From 07b92f78d1751d8a2a538a440e1fdb24c59021e0 Mon Sep 17 00:00:00 2001 From: Pavel Březina Date: Tue, 12 Feb 2013 11:12:59 +0100 Subject: get_next_domain() test dom->parent->next for NULL Otherwise dom may be set to NULL and we will segfault when dereferencing dom. --- src/util/domain_info_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/domain_info_utils.c b/src/util/domain_info_utils.c index d8ca55da1..039d66f86 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; -- cgit