From bdc612a09861af69eb711fd4704bf5641b3209aa Mon Sep 17 00:00:00 2001 From: Herb Lewis Date: Mon, 26 Feb 2007 22:19:23 +0000 Subject: r21548: prevent segv (reference to -1 element of array) (This used to be commit b5fd72282da85f50a040fd949752bc71023ff055) --- source3/nsswitch/idmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source3/nsswitch/idmap.c') diff --git a/source3/nsswitch/idmap.c b/source3/nsswitch/idmap.c index 92c5ca1355..d69fd68e10 100644 --- a/source3/nsswitch/idmap.c +++ b/source3/nsswitch/idmap.c @@ -497,7 +497,8 @@ NTSTATUS idmap_init(void) /**** finished adding idmap_passdb backend ****/ /* sort domains so that the default is the last one */ - if (def_dom_num != num_domains-1) { /* default is not last, move it */ + /* don't sort if no default domain defined */ + if (def_dom_num != -1 && def_dom_num != num_domains-1) { /* default is not last, move it */ struct idmap_domain *tmp; if (pdb_dom_num > def_dom_num) { -- cgit