summaryrefslogtreecommitdiff
path: root/lib/tevent
diff options
context:
space:
mode:
authorRalph Boehme <slow@samba.org>2018-07-17 12:54:29 +0200
committerVolker Lendecke <vl@samba.org>2018-07-17 13:33:06 +0200
commit3761d42e4fe563ad893f14468e98bd1f5a807604 (patch)
tree21b7737820a5995d6ffb2d0518c7c5f9aaf63eb7 /lib/tevent
parent8cb96438bf1540ec76e759135863202bdef6ee35 (diff)
downloadsamba-3761d42e4fe563ad893f14468e98bd1f5a807604.tar.gz
tevent: fix CID 1437976 dereference before null check
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'lib/tevent')
-rw-r--r--lib/tevent/tevent_threads.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/tevent/tevent_threads.c b/lib/tevent/tevent_threads.c
index 21a9b686ba9..a89990f231a 100644
--- a/lib/tevent/tevent_threads.c
+++ b/lib/tevent/tevent_threads.c
@@ -473,7 +473,7 @@ void _tevent_threaded_schedule_immediate(struct tevent_threaded_context *tctx,
#ifdef HAVE_PTHREAD
const char *create_location = im->create_location;
struct tevent_context *main_ev = NULL;
- struct tevent_wrapper_glue *glue = tctx->event_ctx->wrapper.glue;
+ struct tevent_wrapper_glue *glue = NULL;
int ret, wakeup_fd;
ret = pthread_mutex_lock(&tctx->event_ctx_mutex);
@@ -492,6 +492,8 @@ void _tevent_threaded_schedule_immediate(struct tevent_threaded_context *tctx,
return;
}
+ glue = tctx->event_ctx->wrapper.glue;
+
if ((im->event_ctx != NULL) || (handler == NULL)) {
abort();
}