diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-09-20 16:04:01 +0200 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2012-09-28 09:23:07 +0200 |
commit | aa16e201072bb90c1f64d87320cdd2947990ae83 (patch) | |
tree | baa7d6a6af7d433ee03c12dbf9dca78f35b8053a | |
parent | 0e5ecc554393b1899c77d9e15868d651beb8d647 (diff) | |
download | samba-aa16e201072bb90c1f64d87320cdd2947990ae83.tar.gz |
s3:smb2_server: avoid segfault in smbd_smb2_request_pending_queue()
Because we should not call smbd_smb2_request_error() on an
request that is still running.
If the subreq implementes a cancel function, this should
take care of triggering smbd_smb2_request_error.
metze
Signed-off-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 9249871f40aab021d62d3154f8ca286b52f5ef76)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
-rw-r--r-- | source3/smbd/smb2_server.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c index 77f25a9a821..dcaefb16890 100644 --- a/source3/smbd/smb2_server.c +++ b/source3/smbd/smb2_server.c @@ -1297,9 +1297,13 @@ NTSTATUS smbd_smb2_request_pending_queue(struct smbd_smb2_request *req, * request chain. This is not allowed. * Cancel the outstanding request. */ - tevent_req_cancel(req->subreq); + bool ok = tevent_req_cancel(req->subreq); + if (ok) { + return NT_STATUS_OK; + } + TALLOC_FREE(req->subreq); return smbd_smb2_request_error(req, - NT_STATUS_INSUFFICIENT_RESOURCES); + NT_STATUS_INTERNAL_ERROR); } if (DEBUGLEVEL >= 10) { |