From 737d05bfb3538ac33a81efc2f3d8dfaa35a6ef86 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 15 Mar 2006 05:50:42 +0000 Subject: r14431: don't call qsort with a null array (This used to be commit 2c33f577ad5bf8cddec735e75a26c4a4c07d8c51) --- source4/lib/ldb/ldb_tdb/ldb_index.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/lib') 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; } -- cgit