[SSSD] [PATCH] Fix for a seg fault during recursive delete

Sumit Bose sbose at redhat.com
Wed Nov 4 15:43:56 UTC 2009


Hi,

this patch should fix #256.

bye,
Sumit
-------------- next part --------------
>From e0a4112e10a2ecd9251ad22f0d3755c9207bac9d Mon Sep 17 00:00:00 2001
From: Sumit Bose <sbose at redhat.com>
Date: Wed, 4 Nov 2009 16:41:09 +0100
Subject: [PATCH] Fix for a seg fault during recursive delete

---
 server/db/sysdb_ops.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/server/db/sysdb_ops.c b/server/db/sysdb_ops.c
index 0dcf2e3..8e3b5db 100644
--- a/server/db/sysdb_ops.c
+++ b/server/db/sysdb_ops.c
@@ -327,7 +327,7 @@ struct tevent_req *sysdb_delete_recursive_send(TALLOC_CTX *mem_ctx,
     struct tevent_req *req, *subreq;
     struct sysdb_delete_recursive_state *state;
     int ret;
-    const char *no_attrs[] = { NULL };
+    const char **no_attrs;
 
     req = tevent_req_create(mem_ctx, &state,
                             struct sysdb_delete_recursive_state);
@@ -341,6 +341,12 @@ struct tevent_req *sysdb_delete_recursive_send(TALLOC_CTX *mem_ctx,
     state->msgs = NULL;
     state->current_item = 0;
 
+    no_attrs = talloc_array(state, const char *, 1);
+    if (no_attrs == NULL) {
+        ERROR_OUT(ret, ENOMEM, fail);
+    }
+    no_attrs[0] = NULL;
+
     subreq = sysdb_search_entry_send(state, ev, handle, dn, LDB_SCOPE_SUBTREE,
                                      "(distinguishedName=*)", no_attrs);
 
-- 
1.6.2.5



More information about the sssd-devel mailing list