summaryrefslogtreecommitdiff
path: root/source4/smbd
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-06-19 17:59:57 +1000
committerAndrew Bartlett <abartlet@samba.org>2008-06-19 17:59:57 +1000
commit00bde569b79f76ebfc203fe340668de135761dc0 (patch)
treec20062e96015ef1338bb408779d1f97c1f205b47 /source4/smbd
parent48100ca5c6ccfda390ca7804ddbb6726e8631428 (diff)
downloadsamba-00bde569b79f76ebfc203fe340668de135761dc0.tar.gz
samba-00bde569b79f76ebfc203fe340668de135761dc0.tar.bz2
samba-00bde569b79f76ebfc203fe340668de135761dc0.zip
Fix segfault caused by talloc_free() being called while still processing
The problem here was that with the packet code set to serialise, we can have multiple packets 'processing' at once, and previously the second packet (allowed because we are spining on an event context down the stack) would clear the flag. Andrew Bartlett (This used to be commit 33789111241a1d97fc105ec4edd7b8054895b28c)
Diffstat (limited to 'source4/smbd')
-rw-r--r--source4/smbd/service_stream.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source4/smbd/service_stream.c b/source4/smbd/service_stream.c
index e27d87ec75..f27560f6ee 100644
--- a/source4/smbd/service_stream.c
+++ b/source4/smbd/service_stream.c
@@ -85,13 +85,13 @@ void stream_terminate_connection(struct stream_connection *srv_conn, const char
*/
static void stream_io_handler(struct stream_connection *conn, uint16_t flags)
{
- conn->processing = true;
+ conn->processing++;
if (flags & EVENT_FD_WRITE) {
conn->ops->send_handler(conn, flags);
} else if (flags & EVENT_FD_READ) {
conn->ops->recv_handler(conn, flags);
}
- conn->processing = false;
+ conn->processing--;
if (conn->terminate) {
stream_terminate_connection(conn, conn->terminate);