diff options
author | Stefan Metzmacher <metze@samba.org> | 2018-04-20 15:07:08 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2018-07-12 14:25:19 +0200 |
commit | cdbad9041b8afd3f0436fbeb5d6b50f9f1ada60d (patch) | |
tree | f1e2ff2b1cda4d341b106471addf5f6d2cb7bebf /lib | |
parent | f19552e2390636518dc762bb9dfe25d3407dc521 (diff) | |
download | samba-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.c | 9 |
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); |