summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2006-03-15 05:50:42 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:57:23 -0500
commit737d05bfb3538ac33a81efc2f3d8dfaa35a6ef86 (patch)
tree54a4d3206b18b0cea862e455086ad5de5153487d /source4/lib
parent24c76df16637f4fb13e057741591fb398268e857 (diff)
downloadsamba-737d05bfb3538ac33a81efc2f3d8dfaa35a6ef86.tar.gz
samba-737d05bfb3538ac33a81efc2f3d8dfaa35a6ef86.tar.bz2
samba-737d05bfb3538ac33a81efc2f3d8dfaa35a6ef86.zip
r14431: don't call qsort with a null array
(This used to be commit 2c33f577ad5bf8cddec735e75a26c4a4c07d8c51)
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index 2fc20adb30..e2a3201884 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -241,7 +241,9 @@ static int ltdb_index_dn_simple(struct ldb_module *module,
talloc_free(msg);
- qsort(list->dn, list->count, sizeof(char *), (comparison_fn_t) list_cmp);
+ if (list->count > 1) {
+ qsort(list->dn, list->count, sizeof(char *), (comparison_fn_t) list_cmp);
+ }
return 1;
}