summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerb Lewis <herb@samba.org>2007-02-26 22:19:23 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:18:12 -0500
commitbdc612a09861af69eb711fd4704bf5641b3209aa (patch)
tree78ddb428bd1f9f6fe9daa63ec6be52c718654bad
parent28e2069d1f066f20b376d911d6ed582a76c4a713 (diff)
downloadsamba-bdc612a09861af69eb711fd4704bf5641b3209aa.tar.gz
samba-bdc612a09861af69eb711fd4704bf5641b3209aa.tar.bz2
samba-bdc612a09861af69eb711fd4704bf5641b3209aa.zip
r21548: prevent segv (reference to -1 element of array)
(This used to be commit b5fd72282da85f50a040fd949752bc71023ff055)
-rw-r--r--source3/nsswitch/idmap.c3
1 files changed, 2 insertions, 1 deletions
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) {