diff options
author | Herb Lewis <herb@samba.org> | 2007-02-26 22:19:23 +0000 |
---|---|---|
committer | Herb Lewis <herb@samba.org> | 2007-02-26 22:19:23 +0000 |
commit | d137dc084cc1c32a39622383ace685add695b86e (patch) | |
tree | 80563ac0966e416764277a7ad31cd4321f542834 | |
parent | a6467440cde79eb63d92160e4d9e78fa45c53914 (diff) | |
download | samba-d137dc084cc1c32a39622383ace685add695b86e.tar.gz |
r21548: prevent segv (reference to -1 element of array)
-rw-r--r-- | source/nsswitch/idmap.c | 3 |
1 files changed, 2 insertions, 1 deletions
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) { |