summaryrefslogtreecommitdiff
path: root/lib/tevent
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-01-11 08:58:05 +0100
committerKarolin Seeger <kseeger@samba.org>2014-04-01 09:11:19 +0200
commitc77fbd2cf9a555e12597d5a671a534fa7140e523 (patch)
tree160380bccf23d011fcc2cf8aee33af9f1951a07e /lib/tevent
parent71eade3f8f2e6196fb839259e1467c9223086489 (diff)
downloadsamba-c77fbd2cf9a555e12597d5a671a534fa7140e523.tar.gz
tevent: fix crash bug in tevent_queue_immediate_trigger()
Assume we we have a queue with 2 entries (A and B with triggerA() and triggerB()). If triggerA() removes itself tevent_queue_entry_destructor() will be called for A, this schedules the immediate event to call triggerB(). If triggerA() then also removes B by an explicit of implizit talloc_free(), q->list is NULL, but the immediate event is still scheduled and can't be unscheduled. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> (cherry picked from commit 7fe5584e2a59584431cb2ddf8a4da22bfb924454)
Diffstat (limited to 'lib/tevent')
-rw-r--r--lib/tevent/tevent_queue.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/tevent/tevent_queue.c b/lib/tevent/tevent_queue.c
index 4750675802..eeb922fbbc 100644
--- a/lib/tevent/tevent_queue.c
+++ b/lib/tevent/tevent_queue.c
@@ -140,6 +140,10 @@ static void tevent_queue_immediate_trigger(struct tevent_context *ev,
return;
}
+ if (!q->list) {
+ return;
+ }
+
q->list->triggered = true;
q->list->trigger(q->list->req, q->list->private_data);
}