summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2018-04-20 15:07:08 +0200
committerStefan Metzmacher <metze@samba.org>2018-07-12 14:25:19 +0200
commitcdbad9041b8afd3f0436fbeb5d6b50f9f1ada60d (patch)
treef1e2ff2b1cda4d341b106471addf5f6d2cb7bebf /lib
parentf19552e2390636518dc762bb9dfe25d3407dc521 (diff)
downloadsamba-cdbad9041b8afd3f0436fbeb5d6b50f9f1ada60d.tar.gz
pthreadpool: let pthreadpool_tevent_job_send() fail with an invalid pool
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/pthreadpool/pthreadpool_tevent.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/pthreadpool/pthreadpool_tevent.c b/lib/pthreadpool/pthreadpool_tevent.c
index db6d4b2f2e8..0e890cb7ce5 100644
--- a/lib/pthreadpool/pthreadpool_tevent.c
+++ b/lib/pthreadpool/pthreadpool_tevent.c
@@ -301,6 +301,15 @@ struct tevent_req *pthreadpool_tevent_job_send(
state->fn = fn;
state->private_data = private_data;
+ if (pool == NULL) {
+ tevent_req_error(req, EINVAL);
+ return tevent_req_post(req, ev);
+ }
+ if (pool->pool == NULL) {
+ tevent_req_error(req, EINVAL);
+ return tevent_req_post(req, ev);
+ }
+
state->im = tevent_create_immediate(state);
if (tevent_req_nomem(state->im, req)) {
return tevent_req_post(req, ev);