1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-01 04:58:35 +03:00

Fix segfault when sorting LDAP replies on the client.

Andrew Bartlett
(This used to be commit c72c39326b263b3aacd178ddc2fc3b1a2906f3d3)
This commit is contained in:
Andrew Bartlett 2008-01-11 12:47:51 +11:00
parent 3f7ec9bf19
commit 3dab82394e

View File

@ -241,10 +241,10 @@ again:
if (sctx->pending)
goto again;
if (sctx->sort && sctx->num_stored != 0) {
if (sctx->sort && (sctx->num_stored != 0 || sctx->refs != 0)) {
int i;
ldb_qsort(sctx->store, ret, sizeof(struct ldb_message *),
ldb_qsort(sctx->store, sctx->num_stored, sizeof(struct ldb_message *),
ldb, (ldb_qsort_cmp_fn_t)do_compare_msg);
if (ret != 0) {