From 2c33f577ad5bf8cddec735e75a26c4a4c07d8c51 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 15 Mar 2006 05:50:42 +0000 Subject: [PATCH] r14431: don't call qsort with a null array --- source/lib/ldb/ldb_tdb/ldb_index.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/source/lib/ldb/ldb_tdb/ldb_index.c b/source/lib/ldb/ldb_tdb/ldb_index.c index 2fc20adb306..e2a3201884e 100644 --- a/source/lib/ldb/ldb_tdb/ldb_index.c +++ b/source/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; }