From d137dc084cc1c32a39622383ace685add695b86e 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) --- source/nsswitch/idmap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/nsswitch/idmap.c b/source/nsswitch/idmap.c index 92c5ca13553..d69fd68e103 100644 --- a/source/nsswitch/idmap.c +++ b/source/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 v1.2.1