35 lines
1.1 KiB
Diff
35 lines
1.1 KiB
Diff
From ad6a97f4a6908fa8858cd4bb9e5d804e8c29aba0 Mon Sep 17 00:00:00 2001
|
|
From: Volker Lendecke <vl@samba.org>
|
|
Date: Wed, 27 May 2009 18:40:13 +0200
|
|
Subject: [PATCH] Do not segfault in pdb_search_destructor if no real search was started
|
|
(cherry picked from commit d07464b21fe652e205f5eb2c74d12495bab100ce)
|
|
|
|
---
|
|
source3/passdb/pdb_interface.c | 3 ++-
|
|
1 files changed, 2 insertions(+), 1 deletions(-)
|
|
|
|
diff --git a/source3/passdb/pdb_interface.c b/source3/passdb/pdb_interface.c
|
|
index 8c00329..01815c6 100644
|
|
--- a/source3/passdb/pdb_interface.c
|
|
+++ b/source3/passdb/pdb_interface.c
|
|
@@ -1711,7 +1711,7 @@ static NTSTATUS pdb_default_lookup_names(struct pdb_methods *methods,
|
|
|
|
static int pdb_search_destructor(struct pdb_search *search)
|
|
{
|
|
- if (!search->search_ended) {
|
|
+ if ((!search->search_ended) && (search->search_end != NULL)) {
|
|
search->search_end(search);
|
|
}
|
|
return 0;
|
|
@@ -1733,6 +1733,7 @@ struct pdb_search *pdb_search_init(TALLOC_CTX *mem_ctx,
|
|
result->num_entries = 0;
|
|
result->cache_size = 0;
|
|
result->search_ended = False;
|
|
+ result->search_end = NULL;
|
|
|
|
/* Segfault appropriately if not initialized */
|
|
result->next_entry = NULL;
|
|
--
|
|
1.6.6
|
|
|